build image only on new release tag
This commit is contained in:
parent
86c8e76bb1
commit
fdb7c5f4b3
20
.github/workflows/ghcr.yml
vendored
20
.github/workflows/ghcr.yml
vendored
@ -1,12 +1,9 @@
|
|||||||
# build and push releases to ghcr
|
# build and push releases to ghcr
|
||||||
# build for PRs only to test failures
|
|
||||||
|
|
||||||
name: build-and-push-ghcr
|
name: build-and-push-ghcr
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
pull_request:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -30,7 +27,6 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@ -48,21 +44,7 @@ jobs:
|
|||||||
# Optional: also publish :latest for version tags
|
# Optional: also publish :latest for version tags
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
|
|
||||||
- name: Build (PR)
|
- name: Build and push
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: false
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Build and push (tag)
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user