diff --git a/.github/workflows/egress-api-container.yaml b/.github/workflows/containers.yaml similarity index 71% rename from .github/workflows/egress-api-container.yaml rename to .github/workflows/containers.yaml index 67a4a575e..329b1c681 100644 --- a/.github/workflows/egress-api-container.yaml +++ b/.github/workflows/containers.yaml @@ -1,10 +1,10 @@ -name: Egress API Container +name: Build multiple containers on: pull_request: # Only consider PRs that change files for this asset, including ci scripts paths: - - '.github/workflows/egress-api-container.yaml' + - '.github/workflows/containers.yaml' - 'src/Data-Egress-API/**' - 'src/BL/**' # Make sure all workflows that are "required checks" for a given @@ -17,10 +17,9 @@ on: - 'main' # Only consider pushes that change files for this asset, including ci scripts paths: - - '.github/workflows/egress-api-container.yaml' + - '.github/workflows/containers.yaml' - 'src/Data-Egress-API/**' - 'src/BL/**' - permissions: contents: write pull-requests: write @@ -28,24 +27,32 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - # Needed to generate releases safely + # Cancel early on pull requests if new commits are added, + # Don't cancel on release pushes cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: # Job name must be unique across repo to target # branch protection rules "required checks" properly! + setup-containers: + uses: SwanseaUniversityMedical/workflows/.github/workflows/pr-and-release-repo.yaml@v1.0.0-repo + with: + job-name: setup-containers + release-tag-format: 'v${version}-containers' + egress-api-container: - uses: SwanseaUniversityMedical/workflows/.github/workflows/pr-and-release-container.yaml@v2.0.1-containers + needs: setup-containers + uses: SwanseaUniversityMedical/workflows/.github/workflows/bulk-pr-and-release-container.yaml@v1.0.0-bulk-containers with: job-name: egress-api-container registry: ${{ vars.HARBOR_REGISTRY }} registry-user: ${{ vars.HARBOR_USER }} registry-repo: ${{ vars.HARBOR_PROJECT }}/${{ vars.HARBOR_REPO }}-egress-api - release-tag-format: 'DARE-Egress-API-Container-${version}' + release-info: ${{ needs.setup-containers.outputs.release-info }} cosign-public-key: ${{ vars.COSIGN_PUBLIC_KEY }} build-file: src/Data-Egress-API/Dockerfile build-context: src secrets: cosign-private-key: ${{ secrets.COSIGN_PRIVATE_KEY }} cosign-password: ${{ secrets.COSIGN_PASSWORD }} - registry-token: ${{ secrets.HARBOR_TOKEN }} + registry-token: ${{ secrets.HARBOR_TOKEN }} \ No newline at end of file