ci: 添加 GitHub Actions 部署工作流

添加用于构建和部署到 gh-pages 的 CI 工作流配置,在 main 分支推送时自动触发
This commit is contained in:
二叉树树
2025-11-24 18:52:12 +08:00
parent a0169a463e
commit d7ccc71a84

25
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy to page branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: page
cname: ${{ secrets.CNAME }}