Skip to content

Commit 4a5fc86

Browse files
committed
fix: use official GitHub Pages deploy action
1 parent e42d363 commit 4a5fc86

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/deploy-storybook.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@ name: Deploy Storybook to GH Pages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
workflow_dispatch:
77

88
permissions:
9-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
1012

1113
concurrency:
12-
group: deploy-storybook
14+
group: pages
1315
cancel-in-progress: true
1416

1517
jobs:
1618
build-and-deploy:
1719
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
1823
steps:
1924
- name: Checkout
2025
uses: actions/checkout@v4
@@ -31,11 +36,14 @@ jobs:
3136
- name: Build Storybook
3237
run: npm run build-storybook
3338

34-
- name: Deploy to GitHub Pages (gh-pages branch)
35-
uses: peaceiris/actions-gh-pages@v3
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v4
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
3644
with:
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_branch: gh-pages
39-
publish_dir: storybook-static
40-
# Keep history disabled for smaller gh-pages branch
41-
keep_files: false
45+
path: storybook-static
46+
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)