From 394540f8ee7bbdd72dcbe33b83a7886cb8324058 Mon Sep 17 00:00:00 2001 From: Anna Wen <54281166+annawen1@users.noreply.github.com> Date: Mon, 8 Jul 2024 07:44:31 -0400 Subject: [PATCH] chore(gh-actions): trigger deploy env workflows from release --- .github/workflows/deploy-latest.yml | 4 ++-- .github/workflows/deploy-staging.yml | 1 + .github/workflows/release-base.yml | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-latest.yml b/.github/workflows/deploy-latest.yml index b6cc9001ba..0caa21f0fa 100644 --- a/.github/workflows/deploy-latest.yml +++ b/.github/workflows/deploy-latest.yml @@ -4,8 +4,8 @@ name: Deploy production storybook # This workflow is triggered from the `release-base` workflow when a full release # has been successfully completed on: - repository_dispatch: - types: [deploy-latest-storybook] + workflow_dispatch: + workflow_call: jobs: deploy-latest-storybook: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 6f7aa5d94a..a110a86dcd 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -4,6 +4,7 @@ name: Deploy staging storybook # Gets triggered every time a change is pushed to the `release/v2*` branch or can be manually triggered on: workflow_dispatch: + workflow_call: push: branches: [release/v2*] diff --git a/.github/workflows/release-base.yml b/.github/workflows/release-base.yml index 7e12cb496f..318999f5be 100644 --- a/.github/workflows/release-base.yml +++ b/.github/workflows/release-base.yml @@ -114,11 +114,14 @@ jobs: echo "DRY RUN: ${{ env.DRY_RUN }}" yarn lerna publish --create-release github --preid rc --pre-dist-tag next $(echo "${{ env.DRY_RUN }}") - # After successfully publishing a full release, trigger the production storybook environment deployment workflow. - # Pass in the release branch name to the storybook deployment job so it build off the release branch - - name: Dispatch production storybook deployment workflow - if: ${{ (github.event.inputs.type == 'full minor release') || (github.event.inputs.type == 'full patch release') }} - uses: peter-evans/repository-dispatch@v3 - with: - event-type: deploy-latest-storybook - client-payload: '{"branch": "${{ github.ref_name }}"}' + deploy-staging: + needs: release + # Trigger staging storybook enviroment deployment workflow + if: ${{ github.event.inputs.dry-run == 'false' }} + uses: ./.github/workflows/deploy-staging.yml + + deploy-latest: + needs: release + # If full release has been published, trigger the production storybook environment deployment workflow. + if: ${{ (github.event.inputs.dry-run == 'false') && ((github.event.inputs.type == 'full minor release') || (github.event.inputs.type == 'full patch release')) }} + uses: ./.github/workflows/deploy-latest.yml