Skip to content

Commit 4d39852

Browse files
committed
chore: single workflow to avoid race conditions
1 parent f2c0b68 commit 4d39852

2 files changed

Lines changed: 44 additions & 61 deletions

File tree

.github/workflows/promote-to-quay-local.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/publish-images-local.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
# Test Publish Image Workflow
2+
# Test Publish and Promote Image Workflow
3+
# Builds image, pushes to GHCR, promotes to Quay, and signs
34

45
name: Test Publish Images
56

@@ -28,19 +29,21 @@ permissions:
2829
attestations: none
2930
security-events: none
3031
actions: none
32+
3133
# Prevent concurrent runs for the same ref (branch/tag)
3234
concurrency:
3335
group: ${{ github.workflow }}-${{ github.ref }}
3436
cancel-in-progress: false
3537

3638
jobs:
39+
# Step 1: Build and push to GHCR
3740
build-compass:
3841
permissions:
3942
contents: read
40-
packages: write # Required: push images to GHCR
41-
id-token: write # Required: keyless signing (Sigstore OIDC)
42-
attestations: write # Required: generate SBOM/provenance attestations
43-
security-events: write # Required: upload SARIF security scan results
43+
packages: write
44+
id-token: write
45+
attestations: write
46+
security-events: write
4447
actions: read
4548
uses: sonupreetam/org-infra-tests/.github/workflows/reusable_publish_image.yml@main
4649
with:
@@ -54,3 +57,39 @@ jobs:
5457
allowed_identity_regex: https://github.com/sonupreetam/org-infra-tests(/.*)?
5558
force_rebuild: ${{ github.event.inputs.force_rebuild == 'true' }}
5659
secrets: inherit
60+
61+
# Step 2: Promote from GHCR to Quay
62+
promote-compass:
63+
needs: build-compass
64+
permissions:
65+
packages: read
66+
uses: sonupreetam/org-infra-tests/.github/workflows/reusable_promote.yml@main
67+
with:
68+
source_registry: ghcr.io
69+
source_image: sonupreetam/test-compass
70+
source_tag: sha-${{ github.sha }}
71+
dest_registry: quay.io
72+
dest_image: test_complytime/test-compass
73+
dest_tag: ${{ github.ref_name }}
74+
create_semver_tags: false
75+
verify_source_signature: false
76+
allowed_identity_regex: https://github.com/sonupreetam/org-infra-tests(/.*)?
77+
secrets:
78+
dest_username: ${{ secrets.QUAY_USERNAME }}
79+
dest_password: ${{ secrets.QUAY_PASSWORD }}
80+
81+
# Step 3: Sign the promoted image on Quay
82+
sign-compass:
83+
needs: promote-compass
84+
permissions:
85+
packages: write
86+
id-token: write
87+
uses: sonupreetam/org-infra-tests/.github/workflows/reusable_sign_and_verify.yml@main
88+
with:
89+
image_name: quay.io/test_complytime/test-compass
90+
digest: ${{ needs.promote-compass.outputs.digest }}
91+
allowed_identity_regex: https://github.com/sonupreetam/org-infra-tests(/.*)?
92+
verify_attestations: false
93+
secrets:
94+
quay_username: ${{ secrets.QUAY_USERNAME }}
95+
quay_password: ${{ secrets.QUAY_PASSWORD }}

0 commit comments

Comments
 (0)