Files
fuwari/.github/workflows/deploy.yml
二叉树树 24a2c5613b ci: 添加GitHub Actions部署工作流并删除旧文件
添加新的部署工作流配置文件,包含pnpm安装、Node.js设置、依赖安装、构建和部署到gh-pages分支的步骤。同时删除旧的未使用的部署配置文件。
2026-01-22 18:20:16 +08:00

39 lines
872 B
YAML

name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm 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 }}
commit_message: ${{ github.event.head_commit.message }}