Skip to content

Commit c69025e

Browse files
authored
Merge pull request #13 from zendesk/ejenkins/publish-storybook-gh-pages
ci: add workflow for publishing storybook to gh pages
2 parents 0664b41 + 363d1b5 commit c69025e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish Storybook
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
9+
workflow_dispatch:
10+
11+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
12+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
jobs:
24+
build-storybook:
25+
name: Build Storybook and Upload Artifact
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: zendesk/checkout@v4
30+
- uses: zendesk/setup-node@v4
31+
with:
32+
node-version: 20
33+
scope: zendesk
34+
always-auth: 'true'
35+
cache: 'yarn'
36+
- name: Build Storybook files
37+
run: |
38+
yarn install --immutable
39+
yarn build-storybook
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./storybook-static
44+
45+
deploy:
46+
needs: build-storybook
47+
runs-on: ubuntu-latest
48+
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
53+
steps:
54+
- name: Deploy to Github Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4
57+

0 commit comments

Comments
 (0)