Files
ogame-vue-ts/.github/workflows/github-pages.yml
coolxitech 751cb1e341 ci(github-actions): 添加 GitHub Pages 部署工作流
- 新增部署到 GitHub Pages 的自动化流程
- 配置在 main 分支推送时触发构建和部署
- 使用 pnpm 进行依赖安装与项目构建
- 通过 github-pages-deploy-action 推送构建产物至 gh-pages 分支
- 指定 docs 目录作为部署源文件夹
2025-12-15 21:32:46 +08:00

23 lines
459 B
YAML

name: 部署到GitHub Pages
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 代码检出
uses: actions/checkout@v6
- name: 构建前端页面
run: |
npm install -g pnpm && pnpm install
pnpm run build
- name: 推送到 Github
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
branch: gh-pages