Skip to content

Commit d521335

Browse files
committed
Add GitHub Actions workflow to build and deploy to gh-pages
Builds the Vite app on push to main and publishes dist/ to the gh-pages branch, so the live site updates automatically on merge. https://claude.ai/code/session_01DUbsS9TjUPnaAbLQTnyczE
1 parent 69be595 commit d521335

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: pages-deploy
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-and-deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Copy static files into dist
34+
run: |
35+
cp robots.txt dist/robots.txt
36+
cp manifest.json dist/manifest.json
37+
38+
- name: Deploy to gh-pages
39+
uses: peaceiris/actions-gh-pages@v4
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./dist
43+
publish_branch: gh-pages

0 commit comments

Comments
 (0)