Skip to content

Commit 501c564

Browse files
committed
add workflow
1 parent f7ffe92 commit 501c564

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # <-- Important: allows pushing to the repo
14+
15+
steps:
16+
- name: Check out the code
17+
uses: actions/checkout@v3
18+
with:
19+
persist-credentials: false # sometimes helpful for clarity
20+
21+
- name: Use Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Deploy to gh-pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./dist
37+
publish_branch: gh-pages # Explicitly set the target branch
38+
force_orphan: true # Creates or overwrites branch if needed
39+
commit_message: "Deploy from GitHub Actions"

0 commit comments

Comments
 (0)