|
1 | 1 | --- |
2 | | -# Test Publish Image Workflow |
| 2 | +# Test Publish and Promote Image Workflow |
| 3 | +# Builds image, pushes to GHCR, promotes to Quay, and signs |
3 | 4 |
|
4 | 5 | name: Test Publish Images |
5 | 6 |
|
@@ -28,19 +29,21 @@ permissions: |
28 | 29 | attestations: none |
29 | 30 | security-events: none |
30 | 31 | actions: none |
| 32 | + |
31 | 33 | # Prevent concurrent runs for the same ref (branch/tag) |
32 | 34 | concurrency: |
33 | 35 | group: ${{ github.workflow }}-${{ github.ref }} |
34 | 36 | cancel-in-progress: false |
35 | 37 |
|
36 | 38 | jobs: |
| 39 | + # Step 1: Build and push to GHCR |
37 | 40 | build-compass: |
38 | 41 | permissions: |
39 | 42 | 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 |
44 | 47 | actions: read |
45 | 48 | uses: sonupreetam/org-infra-tests/.github/workflows/reusable_publish_image.yml@main |
46 | 49 | with: |
|
54 | 57 | allowed_identity_regex: https://github.com/sonupreetam/org-infra-tests(/.*)? |
55 | 58 | force_rebuild: ${{ github.event.inputs.force_rebuild == 'true' }} |
56 | 59 | 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