Deploy Storybook #17
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
name: Deploy Storybook | |
on: | |
workflow_dispatch: | |
# push: | |
# tags: | |
# # Matches tags that have the shape `vX.Y.Z`. Reference: | |
# # https://help.github.com/en/articles/workflow-syntax-for-github-actions#onpushpull_requesttagsbranches | |
# - 'v[0-9]+.[0-9]+.[0-9]+' | |
# # Ignore tags that use a preid after `vX.Y.Z`, for example: vX.Y.Z-alpha.0 | |
# # https://help.github.com/en/articles/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns | |
# - '!v[0-9]+.[0-9]+.[0-9]+-*' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
jobs: | |
build-storybook: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Install dependencies from our offline mirror | |
run: yarn install --offline | |
- name: Build Vue 2 storybook | |
run: | | |
yarn build:storybook --quiet | |
- name: Switch to Vue 3 branch | |
uses: actions/checkout@v3 | |
with: | |
ref: vNext | |
clean: false | |
path: vNext | |
- name: Install vNext dependencies | |
run: | | |
cd ${GITHUB_WORKSPACE}/vNext/storybook | |
yarn install | |
- name: Build Vue 3 storybook | |
run: | | |
cd ${GITHUB_WORKSPACE}/vNext/storybook | |
yarn build-storybook --quiet --output-dir ${GITHUB_WORKSPACE}/storybook/storybook-static/vue3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'storybook/storybook-static' | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build-storybook | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |