From f33559454e04eb19b1064897d44c93714750d1c1 Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Fri, 14 Oct 2022 16:15:08 -0500 Subject: [PATCH 1/3] Bump atlantis-base:2022.10.14 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de9421d699..e7c69cbd5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -v -o atlantis . # Stage 2 # The runatlantis/atlantis-base is created by docker-base/Dockerfile. -FROM ghcr.io/runatlantis/atlantis-base:2022.10.06 AS base +FROM ghcr.io/runatlantis/atlantis-base:2022.10.14 AS base # Get the architecture the image is being built for ARG TARGETPLATFORM From 02bc67c8023486e37fb57ee85388cc9223de27d0 Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Fri, 14 Oct 2022 16:18:43 -0500 Subject: [PATCH 2/3] atlantis-image: Build on Dockerfile changes in PRs --- .github/workflows/atlantis-image.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/atlantis-image.yml b/.github/workflows/atlantis-image.yml index 3759974fd8..c2e1bc64ec 100644 --- a/.github/workflows/atlantis-image.yml +++ b/.github/workflows/atlantis-image.yml @@ -7,6 +7,10 @@ on: tags: - v*.*.* # stable release like, v0.19.2 - v*.*.*-pre.* # pre release like, v0.19.0-pre.calendardate + pull_request: + paths: + - 'Dockerfile' + - '.github/workflows/atlantis-image.yml' workflow_dispatch: concurrency: @@ -45,7 +49,7 @@ jobs: with: context: . platforms: linux/arm64/v8,linux/amd64,linux/arm/v7 - push: true + push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/atlantis:dev @@ -60,7 +64,7 @@ jobs: with: context: . platforms: linux/arm64/v8,linux/amd64,linux/arm/v7 - push: true + push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }} ghcr.io/${{ github.repository_owner }}/atlantis:prerelease-latest @@ -71,7 +75,7 @@ jobs: with: context: . platforms: linux/arm64/v8,linux/amd64,linux/arm/v7 - push: true + push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }} ghcr.io/${{ github.repository_owner }}/atlantis:latest From e876132b445bf2b129b981f5c9ba7b5bd0e465ed Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Fri, 14 Oct 2022 16:24:40 -0500 Subject: [PATCH 3/3] atlantis-image: init on push & pull_request events --- .github/workflows/atlantis-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/atlantis-image.yml b/.github/workflows/atlantis-image.yml index c2e1bc64ec..35f77fd51b 100644 --- a/.github/workflows/atlantis-image.yml +++ b/.github/workflows/atlantis-image.yml @@ -44,7 +44,7 @@ jobs: # Publish dev image to container registry - name: Build and push atlantis:dev image - if: ${{ github.event_name == 'push'}} + if: ${{ contains(fromJson('["push", "pull_request"]'), github.event_name) }} uses: docker/build-push-action@v3 with: context: . @@ -55,11 +55,11 @@ jobs: # Publish release to container registry - name: populate release version - if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} + if: ${{ contains(fromJson('["push", "pull_request"]'), github.event_name) && startsWith(github.ref, 'refs/tags/') }} run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Build and push atlantis:${{ env.RELEASE_VERSION }} image for pre release - if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-pre.') }} + if: ${{ contains(fromJson('["push", "pull_request"]'), github.event_name) && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-pre.') }} uses: docker/build-push-action@v3 with: context: . @@ -70,7 +70,7 @@ jobs: ghcr.io/${{ github.repository_owner }}/atlantis:prerelease-latest - name: Build and push atlantis:${{ env.RELEASE_VERSION }} image for stable release - if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, '-pre.')) }} + if: ${{ contains(fromJson('["push", "pull_request"]'), github.event_name) && startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, '-pre.')) }} uses: docker/build-push-action@v3 with: context: .