mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 16:05:12 +08:00
ci(github-actions): 添加 GitHub Pages 部署工作流
- 新增部署到 GitHub Pages 的自动化流程 - 配置在 main 分支推送时触发构建和部署 - 使用 pnpm 进行依赖安装与项目构建 - 通过 github-pages-deploy-action 推送构建产物至 gh-pages 分支 - 指定 docs 目录作为部署源文件夹
This commit is contained in:
23
.github/workflows/github-pages.yml
vendored
Normal file
23
.github/workflows/github-pages.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user