Skip to content

Commit 9c9ced8

Browse files
authored
Create node.js.yml
1 parent c0906e3 commit 9c9ced8

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Vite site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["math"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Build project
28+
run: npm run build
29+
30+
- name: Prepare docs folder
31+
run: |
32+
rm -rf docs
33+
mv dist docs
34+
35+
- name: Commit docs folder
36+
run: |
37+
git config user.name "github-actions"
38+
git config user.email "github-actions@github.com"
39+
git add docs
40+
git commit -m "Deploy to docs folder" || echo "No changes to commit"
41+
git push

0 commit comments

Comments
 (0)