-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.32 KB
/
deploy-storybook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Publish Storybook
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Trigger via 'Actions' on GitHub
workflow_dispatch:
# cancel workflow when a newer version of the workflow is triggered on the same github ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy-storybook:
name: Build and Deploy Storybook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- name: Restore cache
uses: actions/cache@v3
with:
path: |
node_modules
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- run: |
yarn install --frozen-lockfile
yarn deploy-storybook --ci --source-branch=main
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}