diff --git a/.github/workflows/atlantis-image.yml b/.github/workflows/atlantis-image.yml index 66ab54ccb..32e8f45fd 100644 --- a/.github/workflows/atlantis-image.yml +++ b/.github/workflows/atlantis-image.yml @@ -20,6 +20,9 @@ concurrency: jobs: build: runs-on: ubuntu-22.04 + env: + RELEASE_TYPE: ${{ contains(github.ref, 'pre') && 'pre' || 'stable' }} + RELEASE_TAG: ${{ contains(github.ref, 'pre') && 'prerelease-latest' || 'latest' }} steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -61,7 +64,7 @@ jobs: startsWith(github.ref, 'refs/tags/') run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: "Build and push atlantis:${{ env.RELEASE_VERSION }} image for ${{ contains(github.ref, 'pre') ? 'pre' : 'stable' }} release" + - name: "Build and push atlantis:${{ env.RELEASE_VERSION }} image for ${{ env.RELEASE_TYPE }} release" if: | contains(fromJson('["push", "pull_request"]'), github.event_name) && startsWith(github.ref, 'refs/tags/') @@ -73,4 +76,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }} - ghcr.io/${{ github.repository_owner }}/atlantis:${{ contains(github.ref, 'pre') ? "prerelease-latest" : "latest") }} + ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_TAG }}