Deploy Storybook #29
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 Vue 3 dependencies | |
run: | | |
cd ${GITHUB_WORKSPACE}/storybook | |
yarn install | |
- name: Build Vue 3 storybook | |
run: | | |
cd ${GITHUB_WORKSPACE}/storybook | |
yarn build-storybook --quiet --output-dir ${GITHUB_WORKSPACE}/storybook/storybook-static/ | |
- name: Switch to Vue 2 branch | |
uses: actions/checkout@v3 | |
with: | |
ref: vue2 | |
clean: false | |
path: vue2 | |
- name: Install vue2 dependencies | |
run: | | |
cd ${GITHUB_WORKSPACE}/vue2 | |
yarn install --offline | |
- name: Build Vue 2 storybook | |
run: | | |
cd ${GITHUB_WORKSPACE}/vue2 | |
yarn info @carbon/vue --json > package-info.jsonl | |
npx vue-cli-service storybook:build -c storybook/.storybook --output-dir ${GITHUB_WORKSPACE}/storybook/storybook-static/vue2 | |
- 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 |