From 75efd6a4f02aa3c2bc3109130af166aa84a645ef Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 24 Apr 2024 15:46:56 +1000 Subject: [PATCH 1/4] build: publish multiarch images --- .github/workflows/build_and_publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 0a7ace83..c3bde2cf 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -52,6 +52,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 90679787fae23db8081929cdcb601ec44d12a516 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 24 Apr 2024 15:50:50 +1000 Subject: [PATCH 2/4] build: use ${ARCH} for GOARCH in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b9b6fd75..c651cc76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY controllers/ controllers/ COPY internal/ internal/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details From 104fec62d9fa31ec198ab7ab34944f8109259d7f Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 24 Apr 2024 18:08:18 +1000 Subject: [PATCH 3/4] build: enable PR image building --- .github/workflows/build_and_publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index c3bde2cf..55f1fe20 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -34,14 +34,12 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub - if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR - if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: registry: ghcr.io @@ -53,6 +51,6 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From a84b30bd48891ccee0675d0d52d593024c67805a Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 24 Apr 2024 18:12:55 +1000 Subject: [PATCH 4/4] build: update github action versions --- .github/workflows/build_and_publish.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 55f1fe20..b376c404 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -16,11 +16,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | @@ -28,26 +28,26 @@ jobs: ghcr.io/uselagoon/remote-controller - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64