From 31b0fae3e921129f092186e6f7c59c2d7b175a9e Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Tue, 10 Dec 2024 16:17:51 +1100 Subject: [PATCH] Update to infrastructure v2 (#28) * ci.yml: Update to infra v2 * Update workflow references to v2 --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a2ccbfc..f1ec1fd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,7 +10,7 @@ on: jobs: cd: name: CD - uses: access-nri/build-cd/.github/workflows/cd.yml@main + uses: access-nri/build-cd/.github/workflows/cd.yml@v2 with: model: ${{ vars.NAME }} permissions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e2601..d609df5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,13 +21,17 @@ jobs: name: CI # This job is responsible for checks and prerelease deployments # that happen when a PR is modified or opened - if: github.event_name == 'pull_request' && github.event.action != 'closed' - uses: access-nri/build-cd/.github/workflows/ci.yml@main + if: >- + (github.event_name == 'pull_request' && github.event.action != 'closed') || + (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '!redeploy')) + uses: access-nri/build-cd/.github/workflows/ci.yml@v2 with: model: ${{ vars.NAME }} + pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.event.issue.number }} permissions: pull-requests: write contents: write + statuses: write secrets: inherit # inherit GitHub Deployment Environment secrets pr-comment: @@ -35,7 +39,7 @@ jobs: # This job is responsible for handling Command Comments like # `!bump` during an open PR if: github.event_name == 'issue_comment' - uses: access-nri/build-cd/.github/workflows/ci-comment.yml@main + uses: access-nri/build-cd/.github/workflows/ci-comment.yml@v2 with: model: ${{ vars.NAME }} permissions: @@ -48,7 +52,7 @@ jobs: # This job is responsible for cleaning up the Prereleases after a # PR is closed if: github.event_name == 'pull_request' && github.event.action == 'closed' - uses: access-nri/build-cd/.github/workflows/ci-closed.yml@main + uses: access-nri/build-cd/.github/workflows/ci-closed.yml@v2 with: model: ${{ vars.NAME }} secrets: inherit # inherit GitHub Deployment environment secrets