Skip to content

Commit

Permalink
add condition, push only from main
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Gonzalez V <[email protected]>
  • Loading branch information
sxd authored and NiccoloFei committed Jan 27, 2025
1 parent e446018 commit cd2162d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/bake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ jobs:
sarif_file: snyk.sarif

# Use the metadata generated in the `testbuild` step to find all the images
# that have been built. We copy them one by one to the procuction registry
# that have been built. We copy them one by one to the production registry
# using skopeo. Then we sign the production images too.
copytoproduction:
name: Copy images to production
if: github.event.inputs.environment == 'production' || github.event_name == 'schedule'
if: |
github.ref == 'refs/heads/main' &&
( github.event.inputs.environment == 'production' || github.event_name == 'schedule' )
runs-on: ubuntu-latest
needs:
- testbuild
Expand Down Expand Up @@ -182,4 +184,4 @@ jobs:
'
)
echo "Signing ${images}"
cosign sign --yes ${images}
cosign sign --yes ${images}

0 comments on commit cd2162d

Please sign in to comment.