Skip to content

Commit

Permalink
feat: 添加自动构建文档流程
Browse files Browse the repository at this point in the history
Signed-off-by: Tenny <joel.shu@qq.com>
  • Loading branch information
Tenny committed Feb 2, 2024
1 parent a32d60d commit bd97483
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Pages

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci

- name: Build Site
run: npm run build

- name: Deploy Site
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git checkout gh-pages
cp -r docs/* .
git add .
git commit -m "Deploy to GitHub Pages"
git push

0 comments on commit bd97483

Please sign in to comment.