Skip to content

Commit af2e9ed

Browse files
committed
workflows: publish images on tags rather than on releases
This would avoid the draft release issue of triggering image building twice
1 parent 37dad2b commit af2e9ed

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/atlantis-image.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: atlantis-image
33
on:
44
push:
55
branches:
6-
- "master"
7-
release:
8-
types:
9-
- "published"
6+
- 'master'
7+
tags:
8+
- 'v*.*.*'
109
workflow_dispatch:
1110

1211
jobs:
@@ -47,10 +46,10 @@ jobs:
4746
4847
# Publish release to container registry
4948
- name: populate release version
50-
if: ${{ github.event_name == 'release'}}
49+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
5150
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
5251
- name: Build and push atlantis:${{ env.RELEASE_VERSION }} image
53-
if: ${{ github.event_name == 'release'}}
52+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
5453
uses: docker/build-push-action@v2
5554
with:
5655
context: .

0 commit comments

Comments
 (0)