2023-03-07 10:39:51 +00:00
|
|
|
name: Deploy storybook to pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
# Runs on pushes targeting the default branch
|
|
|
|
push:
|
2023-03-07 10:40:49 +00:00
|
|
|
branches: ["master"]
|
2023-03-07 10:41:34 +00:00
|
|
|
# paths: ["src/components/**"]
|
2023-03-07 10:39:51 +00:00
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Default to bash
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Build job
|
|
|
|
build:
|
2023-03-07 10:43:49 +00:00
|
|
|
env:
|
|
|
|
LINGDOCS_NPM_TOKEN: ${{ secrets.LINGDOCS_NPM_TOKEN }}
|
2023-03-07 10:39:51 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: "18"
|
|
|
|
cache: yarn
|
|
|
|
- name: Setup Pages
|
|
|
|
id: pages
|
|
|
|
uses: actions/configure-pages@v2
|
|
|
|
- name: Install dependencies
|
2023-03-07 10:44:51 +00:00
|
|
|
run: yarn install-r
|
2023-03-07 10:39:51 +00:00
|
|
|
- name: Build storybook
|
2023-03-07 10:50:03 +00:00
|
|
|
run: export NODE_OPTIONS=--openssl-legacy-provider && cd src/components && yarn build-storybook
|
2023-03-07 10:39:51 +00:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
|
|
|
with:
|
2023-03-07 10:46:46 +00:00
|
|
|
path: ./src/components/storybook-static
|
2023-03-07 10:39:51 +00:00
|
|
|
|
|
|
|
# Deployment job
|
|
|
|
deploy:
|
2023-03-07 10:43:49 +00:00
|
|
|
env:
|
|
|
|
LINGDOCS_NPM_TOKEN: ${{ secrets.LINGDOCS_NPM_TOKEN }}
|
2023-03-07 10:39:51 +00:00
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v1
|