Skip to content

Commit 31c7080

Browse files
authored
Merge pull request #3933 from github/koesie10/build-storybook
Add workflow for building and deploying Storybook
2 parents cd2a8d6 + 94e8283 commit 31c7080

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/build-storybook.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Storybook
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
push:
8+
branches:
9+
- main
10+
11+
permissions: {}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version-file: extensions/ql-vscode/.nvmrc
25+
26+
- name: Install dependencies
27+
run: |
28+
cd extensions/ql-vscode
29+
npm ci
30+
shell: bash
31+
32+
- name: Build Storybook
33+
run: |
34+
cd extensions/ql-vscode
35+
npm run build-storybook
36+
shell: bash
37+
38+
- name: Upload to GitHub Pages
39+
id: deployment
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: extensions/ql-vscode/storybook-static
43+
44+
deploy:
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
49+
runs-on: ubuntu-latest
50+
permissions:
51+
id-token: write
52+
pages: write
53+
needs: build
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)