Refine Docker metadata extraction and build conditions for master branch

This commit is contained in:
Joakim Hellsén 2025-12-04 17:45:45 +01:00
commit 71f29c3467
No known key found for this signature in database

View file

@ -40,16 +40,16 @@ jobs:
# Extract metadata (tags, labels) from Git reference and GitHub events for Docker # Extract metadata (tags, labels) from Git reference and GitHub events for Docker
- id: meta - id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
if: github.event_name != 'pull_request' if: github.ref == 'refs/heads/master'
with: with:
images: ghcr.io/thelovinator1/anewdawn images: ghcr.io/thelovinator1/anewdawn
tags: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} tags: type=raw,value=latest
# Build and push the Docker image # Build and push the Docker image
- uses: docker/build-push-action@v6 - uses: docker/build-push-action@v6
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: true
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}