Skip to content

Commit 7a6eca2

Browse files
feat: refactor CD workflow to streamline deployment process and integrate Vite app build
1 parent 4720eb4 commit 7a6eca2

1 file changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/cd.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
1-
name: CD - Deploy Storybook
1+
name: CD - Deploy
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
deploy-storybook:
9+
deploy:
1010
runs-on: ubuntu-latest
11-
environment:
12-
name: github-pages
1311
permissions:
1412
contents: read
1513
pages: write
1614
id-token: write
1715
steps:
1816
- name: Checkout repo
1917
uses: actions/checkout@v4
20-
with:
21-
persist-credentials: false
2218

2319
- name: Setup Node.js
2420
uses: actions/setup-node@v4
2521
with:
2622
node-version: 22
2723

28-
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build Vite app
28+
run: npm run build
29+
30+
- name: Build Storybook
31+
run: npm run build-storybook
32+
33+
- name: Prepare deployment directory
34+
run: |
35+
mkdir public
36+
cp -r dist/* public/
37+
mkdir -p public/storybook
38+
cp -r storybook-static/* public/storybook/
39+
40+
- name: Deploy to GitHub Pages
41+
uses: peaceiris/actions-gh-pages@v4
2942
with:
30-
install_command: npm ci
31-
build_command: npm run build-storybook
32-
path: storybook-static
33-
checkout: false
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: ./public
45+
commit_message: 'Deploy Vite + Storybook [ci skip]'

0 commit comments

Comments
 (0)