Refine Docker metadata extraction and build conditions for master branch
This commit is contained in:
parent
dcfc76bdc9
commit
71f29c3467
1 changed files with 4 additions and 4 deletions
8
.github/workflows/docker-publish.yml
vendored
8
.github/workflows/docker-publish.yml
vendored
|
|
@ -40,16 +40,16 @@ jobs:
|
|||
# Extract metadata (tags, labels) from Git reference and GitHub events for Docker
|
||||
- id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
if: github.event_name != 'pull_request'
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
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
|
||||
- uses: docker/build-push-action@v6
|
||||
if: github.event_name != 'pull_request'
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
push: true
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue