Skip to content

Commit bac1ec3

Browse files
committed
add the trigger workflow by release
1 parent baca682 commit bac1ec3

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

.github/workflows/publish_container.yaml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Create and publish a Docker image
33

44
# Configures this workflow to run every time a change is pushed to the branch called `release`.
55
on:
6-
push:
7-
branches: ["master"]
6+
release:
7+
types: [published]
88
workflow_dispatch:
9-
9+
1010
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
1111
env:
1212
REGISTRY: ghcr.io
@@ -56,8 +56,6 @@ jobs:
5656
tags: ${{ steps.meta.outputs.tags }}
5757
labels: ${{ steps.meta.outputs.labels }}
5858
annotations: ${{ steps.meta.outputs.annotations }}
59-
# cache-from: type=gha
60-
# cache-to: type=gha,mode=max
6159
- name: Generate SBOM for the dev Docker image
6260
uses: anchore/sbom-action@v0
6361
with:
@@ -73,32 +71,4 @@ jobs:
7371
with:
7472
sbom: sbom-image-latest.json
7573
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
76-
subject-digest: ${{ steps.build-push-latest.outputs.digest }}
77-
# test
78-
# - name: Extract metadata (tags, labels) for dev image
79-
# id: meta2
80-
# uses: docker/metadata-action@v5
81-
# with:
82-
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
83-
# flavor: |
84-
# latest=true
85-
# tags: |
86-
# type=ref,event=branch
87-
# type=sha,format=long
88-
# - name: Build and push dev image
89-
# id: build-push-development
90-
# uses: docker/build-push-action@v5
91-
# with:
92-
# context: .
93-
# push: true
94-
# target: development
95-
# tags: ${{ steps.meta2.outputs.tags }}
96-
# labels: ${{ steps.meta2.outputs.labels }}
97-
# annotations: ${{ steps.meta2.outputs.annotations }}
98-
# cache-from: type=gha
99-
# cache-to: type=gha,mode=max
100-
# - name: Attest dev image
101-
# uses: github-early-access/generate-build-provenance@main
102-
# with:
103-
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
104-
# subject-digest: ${{ steps.build-push-development.outputs.digest }}
74+
subject-digest: ${{ steps.build-push-latest.outputs.digest }}

0 commit comments

Comments
 (0)