Skip to content

Commit

Permalink
workflows: publish images on tags rather than on releases
Browse files Browse the repository at this point in the history
This would avoid the draft release issue of triggering image building twice
  • Loading branch information
chenrui333 authored and krrrr38 committed Dec 16, 2022
1 parent db4eafb commit 68a7868
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/atlantis-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: atlantis-image
on:
push:
branches:
- "master"
release:
types:
- "published"
- 'master'
tags:
- 'v*.*.*'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -47,10 +46,10 @@ jobs:
# Publish release to container registry
- name: populate release version
if: ${{ github.event_name == 'release'}}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push atlantis:${{ env.RELEASE_VERSION }} image
if: ${{ github.event_name == 'release'}}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v2
with:
context: .
Expand Down

0 comments on commit 68a7868

Please sign in to comment.