Skip to content

Commit

Permalink
simplify release
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Jul 20, 2024
1 parent d4a5fba commit ed119d1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/dockerimage-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set lower case repository owner name
run: echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Enable docker multiarch
uses: docker/setup-qemu-action@v3
- name: Fix docker logs
Expand Down Expand Up @@ -110,7 +104,7 @@ jobs:
env.BUILDKIT_STEP_LOG_MAX_SIZE=-1
env.BUILDKIT_STEP_LOG_MAX_SPEED=-1
default-load=true
- name: Build the Docker images
- name: Build the Docker image
run: make "OWNER=$OWNER_LC" build_${{matrix.arch}}
- name: Tag and push the Docker images
run: make "OWNER=$OWNER_LC" release
- name: Push the Docker image
run: make "OWNER=$OWNER_LC" push_${{matrix.arch}}
34 changes: 33 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OWNER = phusion
DISABLE_OPTIMIZATIONS = 0
IMAGE = $(IMG_REPO)/$(OWNER)/holy-build-box

.PHONY: build_amd64 test_amd64 tags_amd64 push_amd64 build_arm64 test_arm64 tags_arm64 push_arm64 export_amd64 export_arm64 release
.PHONY: build_amd64 test_amd64 tags_amd64 push_amd64 build_arm64 test_arm64 tags_arm64 push_arm64 export_amd64 export_arm64 release pull_amd64 pull_arm64 cross_tag_arm64 cross_tag_amd64 pull cross_tag

build_amd64:
docker buildx build --load --platform "linux/amd64" --rm -t $(IMAGE):$(VERSION)-amd64 --pull --build-arg DISABLE_OPTIMIZATIONS=$(DISABLE_OPTIMIZATIONS) .
Expand Down Expand Up @@ -67,3 +67,35 @@ ifdef MAJOR_VERSION
docker manifest push $(IMAGE):latest
@echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)"
endif

pull_amd64:
docker pull $(IMAGE):$(VERSION)-amd64
ifdef MAJOR_VERSION
docker pull $(IMAGE):$(MAJOR_VERSION)-amd64
docker pull $(IMAGE):latest-amd64
endif

pull_arm64:
docker pull $(IMAGE):$(VERSION)-arm64
ifdef MAJOR_VERSION
docker pull $(IMAGE):$(MAJOR_VERSION)-arm64
docker pull $(IMAGE):latest-arm64
endif

pull: pull_amd64 pull_arm64

cross_tag_amd64:
docker tag ghcr.io/$(OWNER)/holy-build-box:$(VERSION)-amd64 $(IMAGE):$(VERSION)-amd64
ifdef MAJOR_VERSION
docker tag ghcr.io/$(OWNER)/holy-build-box:$(MAJOR_VERSION)-amd64 $(IMAGE):$(MAJOR_VERSION)-amd64
docker tag ghcr.io/$(OWNER)/holy-build-box:latest-amd64 $(IMAGE):latest-amd64
endif

cross_tag_arm64:
docker tag ghcr.io/$(OWNER)/holy-build-box:$(VERSION)-arm64 $(IMAGE):$(VERSION)-arm64
ifdef MAJOR_VERSION
docker tag ghcr.io/$(OWNER)/holy-build-box:$(MAJOR_VERSION)-arm64 $(IMAGE):$(MAJOR_VERSION)-arm64
docker tag ghcr.io/$(OWNER)/holy-build-box:latest-arm64 $(IMAGE):latest-arm64
endif

cross_tag: cross_tag_amd64 cross_tag_arm64

0 comments on commit ed119d1

Please sign in to comment.