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 committed Jan 25, 2022
1 parent 37dad2b commit af2e9ed
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 af2e9ed

Please sign in to comment.