deploy-latest-storybook #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deploy production storybook environment from release branch to Github Pages | |
name: Deploy production storybook | |
# This workflow is triggered from the `release-base` workflow when a full release | |
# has been successfully completed | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [deploy-latest-storybook] | |
jobs: | |
deploy-latest-storybook: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
# Checkout release branch to build storybook | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | |
with: | |
fetch-depth: '0' | |
ref: ${{ github.event.client_payload.branch }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: https://registry.npmjs.org | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install | |
- name: Build storybook | |
run: yarn storybook:build | |
# Deploy to staging Github Pages using `gh-pages` package | |
- name: Deploy to latest | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npx gh-pages -d packages/core/storybook-static -u "github-actions-bot <[email protected]>" --dest latest --message "chore(deploy): deploy to gh-pages latest" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |