Skip to content

Commit 180a4f5

Browse files
committed
ci: add publish storybook
1 parent de2712e commit 180a4f5

File tree

6 files changed

+87
-4
lines changed

6 files changed

+87
-4
lines changed

.changeset/large-pans-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-dsv-import': patch
3+
---
4+
5+
Upgrade dependencies

.github/workflows/cd-deploy.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
env:
20+
BUILD_PATH: "."
21+
22+
jobs:
23+
build:
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ inputs.ref }}
33+
34+
- name: Setup pnpm
35+
uses: pnpm/action-setup@v4
36+
37+
- name: Setup Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
cache: "pnpm"
42+
43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v5
46+
47+
- name: Install dependencies
48+
run: pnpm install --frozen-lockfile
49+
working-directory: ${{ env.BUILD_PATH }}
50+
51+
- name: Build Storybook
52+
run: |
53+
pnpm nx build-storybook react-dsv-import
54+
working-directory: ${{ env.BUILD_PATH }}
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: ${{ env.BUILD_PATH }}/packages/react-dsv-import/storybook-static
60+
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
needs: build
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

.github/workflows/cd-packages.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup Node
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: 22
28+
node-version: 20
2929
registry-url: https://registry.npmjs.org
3030
cache: pnpm
3131

@@ -52,3 +52,11 @@ jobs:
5252
ref: ${{ needs.publish-packages.outputs.ref }}
5353
secrets: inherit
5454
if: ${{ needs.publish-packages.outputs.published }}
55+
56+
deploy-to-static-file-host:
57+
name: Deploy to Static File Host
58+
uses: ./.github/workflows/cd-deploy.yml
59+
needs: publish-packages
60+
with:
61+
ref: ${{ needs.publish-packages.outputs.ref }}
62+
if: ${{ needs.publish-packages.outputs.published }}

.github/workflows/cd-registries.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Node
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 22
26+
node-version: 20
2727
registry-url: https://registry.npmjs.org
2828
cache: pnpm
2929

.github/workflows/ci-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Node
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 22
26+
node-version: 20
2727
registry-url: https://registry.npmjs.org
2828
cache: pnpm
2929

.github/workflows/ci-version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Node
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 22
22+
node-version: 20
2323
registry-url: https://registry.npmjs.org
2424
cache: pnpm
2525

0 commit comments

Comments
 (0)