mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
- 新增部署到 GitHub Pages 的自动化流程 - 配置在 main 分支推送时触发构建和部署 - 使用 pnpm 进行依赖安装与项目构建 - 通过 github-pages-deploy-action 推送构建产物至 gh-pages 分支 - 指定 docs 目录作为部署源文件夹
23 lines
459 B
YAML
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 |