-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 920 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PROJECT = wordpress
NAME = registry.ilhamjs.io/$(PROJECT)
ARCH ?= amd64
VERSION = 0.0.1-$(ARCH)
.PHONY: build build-nocache tag-latest push push-latest release git-tag-version
export DOCKER_BUILDKIT=1
build:
@echo "Using GitHub Token from ENV"
@if [ -z "$$GITHUB_PERSONAL_ACCESS_TOKEN" ]; then echo "Error: GITHUB_PERSONAL_ACCESS_TOKEN is not set" && exit 1; fi
@echo "$$GITHUB_PERSONAL_ACCESS_TOKEN" > github_token.txt
docker build --secret id=github_token,src=github_token.txt \
-f Dockerfile -t $(NAME):$(VERSION) --platform=linux/$(ARCH) --rm .
@rm -f github_token.txt
tag-latest:
docker tag $(NAME):$(VERSION) $(NAME):$(ARCH)-latest
push:
docker push $(NAME):$(VERSION)
push-latest:
docker push $(NAME):$(ARCH)-latest
release: build tag-latest push push-latest
git-tag-version: release
git tag -a v$(VERSION) -m "v$(VERSION)"
clean:
docker image prune -f
remove:
docker rmi $(NAME):$(VERSION)