Skip to content

Commit

Permalink
ci: add logic to only run certain registries on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
MSevey committed Feb 5, 2024
1 parent 1550a30 commit 3e26994
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/reusable_dockerfile_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ jobs:

docker-build:
name: docker-build (${{ matrix.registry.name }}; ${{ matrix.registry.registry-url }}/${{ matrix.registry.registry-owner }}/${{ needs.prepare-env.outputs.output_image_name }})
# We only want to run when the registry is able to run on pr or if it is a merge event
if: ${{ matrix.registry.run-on-pr == build_for_pr || needs.prepare-env.outputs.build_for_merge == 'true'}}
runs-on: "ubuntu-latest"
# wait until the jobs are finished.
needs: ["prepare-env", "logic-check", "docker-security"]
Expand All @@ -181,22 +183,27 @@ jobs:
packages: write
strategy:
matrix:
# run-on-pr is used to skip running registries that are expected to fail
# due to github permission issues with org wide secrets.
registry:
- name: DockerHub
user-secret: DOCKERHUB_USERNAME
token-secret: DOCKERHUB_TOKEN
registry-url: docker.io
registry-owner: celestiaorg
run-on-pr: false
- name: GHCR
user-secret: ${{ github.repository_owner }}
token-secret: GITHUB_TOKEN
registry-url: ghcr.io
registry-owner: ${{ needs.prepare-env.outputs.repo_owner }}
run-on-pr: true
- name: ScaleWay
user-secret: SCALEWAY_USERNAME
token-secret: SCW_SECRET_KEY
registry-url: rg.fr-par.scw.cloud
registry-owner: celestiaorg
run-on-pr: false
fail-fast: false
steps:
- name: Checkout
Expand Down

0 comments on commit 3e26994

Please sign in to comment.