mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-01 22:28:39 +00:00
fix(ci): only push docker dev tag on main (#3393)
- Disables pushing a dev tag within an unmerged pr commit event. - Also disabled pushing at all unless the event comes from the main branch
This commit is contained in:
8
.github/workflows/atlantis-image.yml
vendored
8
.github/workflows/atlantis-image.yml
vendored
@@ -31,8 +31,8 @@ jobs:
|
||||
env:
|
||||
# Set docker repo to either the fork or the main repo where the branch exists
|
||||
DOCKER_REPO: ghcr.io/${{ github.repository }}
|
||||
# Push if not a pull request or this is a fork
|
||||
PUSH: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
|
||||
# Push if not a pull request and references the main branch
|
||||
PUSH: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -75,9 +75,9 @@ jobs:
|
||||
type=semver,pattern={{version}},prefix=v,enable=${{ matrix.image_type == 'alpine' }}
|
||||
type=semver,pattern={{major}}.{{minor}},prefix=v,suffix=${{ env.SUFFIX }}
|
||||
# dev
|
||||
type=raw,value=dev,suffix=${{ env.SUFFIX }}-{{ sha }}
|
||||
type=raw,event=push,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'main') && matrix.image_type == 'alpine' }},suffix=
|
||||
type=raw,event=push,value=dev,enable={{is_default_branch}},suffix=${{ env.SUFFIX }}
|
||||
type=raw,event=push,value=dev,enable={{is_default_branch}},suffix=${{ env.SUFFIX }}-{{ sha }}
|
||||
type=raw,event=push,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'main') && matrix.image_type == 'alpine' }},suffix=
|
||||
# prerelease
|
||||
type=raw,event=tag,value=prerelease-latest,enable=${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'pre') && matrix.image_type == 'alpine' }},suffix=
|
||||
type=raw,event=tag,value=prerelease-latest,enable=${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'pre') }},suffix=${{ env.SUFFIX }}
|
||||
|
||||
Reference in New Issue
Block a user