Skip to content

Commit

Permalink
chore(gh-actions): trigger deploy env workflows from release
Browse files Browse the repository at this point in the history
  • Loading branch information
annawen1 committed Jul 8, 2024
1 parent 48d7f89 commit 394540f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*]

Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/release-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 394540f

Please sign in to comment.