Skip to content

build(构建): 自动化 #6

build(构建): 自动化

build(构建): 自动化 #6

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- master # 或者是你的默认分支名称
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '20' # 或者你使用的 Node.js 版本
- name: Build project
run: |
npm install -g yarn
yarn install
npm run build
rm -rf docs
mkdir docs
cp -rf dist/* docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist