Trigger Docker build only on published releases

This commit is contained in:
Chris Scott committed 2025-12-13 23:05:56 -05:00
1 parent 5e944bb107
commit 7cec19f7cc
1 file changed
+5 -30
+5 -30
View File
@@ -1,31 +1,8 @@
name: Docker Build
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/docker-build.yml'
- 'backend/**'
- 'frontend/**'
- 'shared/**'
- 'Dockerfile'
- 'scripts/**'
push:
branches:
- main
paths:
- 'backend/**'
- 'frontend/**'
- 'shared/**'
- 'Dockerfile'
- 'scripts/**'
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
release:
types: [published]
permissions:
contents: read
@@ -44,13 +21,10 @@ jobs:
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=pr,prefix=pr-
type=edge,branch=main
type=sha,prefix=commit-,format=short,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@@ -70,8 +44,9 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
target: runner