Skip to content

Commit db09ba0

Browse files
committed
add a github workflow to auto-deploy
1 parent 1a92314 commit db09ba0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '16'
19+
- name: Install Dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run build
23+
- name: Configure Git
24+
run: |
25+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
26+
git config --global user.name "github-actions[bot]"
27+
- name: Deploy to GitHub Pages
28+
env:
29+
CI: true
30+
GIT_USER: github-actions[bot] # Add user for gh-pages package
31+
GITHUB_TOKEN: ${{ github.token }} # Authenticate with the token
32+
run: npx gh-pages -d build --repo https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git
33+
34+

0 commit comments

Comments
 (0)