Skip to content

Commit 59b5461

Browse files
committed
fix(workflow): broaden conditions for publishing, signing, and DockerHub update steps
Expanded job 'if' conditions to include 'workflow_dispatch' and 'release' events in addition to 'push' to main.
1 parent 07d2d52 commit 59b5461

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/build-and-publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: docker/setup-buildx-action@v3
2828

2929
- name: Log in to GitHub Container Registry
30-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
30+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') || github.event_name == 'release' }}
3131
uses: docker/login-action@v2
3232
with:
3333
registry: ghcr.io
@@ -78,11 +78,11 @@ jobs:
7878
platforms: linux/amd64,linux/arm64
7979

8080
- name: Set up cosign
81-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
81+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') || github.event_name == 'release' }}
8282
uses: sigstore/cosign-installer@v3
8383

8484
- name: Sign the container image with cosign
85-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
85+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') || github.event_name == 'release' }}
8686
run: |
8787
cosign sign --yes ghcr.io/obeone/crawler-to-md@${DIGEST}
8888
cosign sign --yes docker.io/obeoneorg/crawler-to-md@${DIGEST}
@@ -91,7 +91,7 @@ jobs:
9191
DIGEST: ${{ steps.docker_build.outputs.digest }}
9292

9393
- name: Update Docker Hub description
94-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
94+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') || github.event_name == 'release' }}
9595
uses: peter-evans/dockerhub-description@v4
9696
with:
9797
username: ${{ secrets.DOCKERHUB_USERNAME }}

0 commit comments

Comments
 (0)