-
Notifications
You must be signed in to change notification settings - Fork 178
77 lines (67 loc) · 2.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy to GH Pages
on:
push:
# Don't run for irrelevant changes.
paths-ignore:
- 'docs/**'
- '!.github/workflows/deploy-storybook.yml'
- '.storybook/**'
- '.wordpress-org/**'
- '__mocks__/**'
- '__static__/**'
- 'bin/**'
- 'tests/**'
branches:
- main
permissions:
contents: read
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the (target) branch name.
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-storybook:
name: Build storybook
runs-on: ubuntu-latest
permissions:
contents: write # for Git to git push
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Setup Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install dependencies
run: npm ci
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Build storyook
run: npm run storybook:build
- name: Checkout gh-pages
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: gh-pages
token: ${{ secrets.GOOGLEFORCREATORS_BOT_TOKEN }}
path: gh-pages
- name: Move storybook assets
run: |
rm -rf gh-pages/storybook/*
mv build/storybook/* gh-pages/storybook/
- name: Commit updates
run: |
git add .
git status
git diff --staged --quiet && echo 'No changes to commit; exiting!' && exit 0
git commit -m "Deploy storybook for ${{ github.sha }}"
git pull --rebase --no-edit --quiet
git push origin gh-pages
env:
GIT_AUTHOR_EMAIL: 94923726+googleforcreators-bot@users.noreply.github.com
GIT_AUTHOR_NAME: googleforcreators-bot
GIT_COMMITTER_EMAIL: 94923726+googleforcreators-bot@users.noreply.github.com
GIT_COMMITTER_NAME: googleforcreators-bot
working-directory: ./gh-pages