-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (42 loc) · 1.49 KB
/
deploy-github-pages.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
name: Publish Storybook to GitHub Pages
on:
push:
branches:
- 'main'
# WARNING: This allows storybook-branch-switcher CLI to run `npm run ${arbitrary_script}`
# BUT the worst it can do is:
# - force changes to our GitHub Pages website,
# - force commit status updates,
# unless the permissions key below is changed.
pull_request_target:
types: [opened, synchronize, reopened]
# Be careful about changing these, due to pull_request_target trigger.
permissions:
contents: read
pages: write
id-token: write
statuses: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# See: https://github.com/bitovi/github-actions-storybook-to-github-pages
- uses: bitovi/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
build_command: "npx sb-branch-switcher --config .storybook/.branches.json"
path: dist/storybook-bundle
# Done manually so we can checkout submodule
checkout: false
# See: https://github.com/ouzi-dev/commit-status-updater/pull/533
- uses: patcon/commit-status-updater@patch-1
if: ${{ github.event_name == 'pull_request_target' }}
with:
status: "success"
url: "https://civictechto.github.io/polis-storybook/PR-${{ github.event.number }}/"
name: "Storybook"
description: "This branch now available."