Files
ogame-vue-ts/.github/workflows/github-pages.yml
coolxitech a592713623 chore(github-pages): 配置 GitHub Pages 环境变量
- 添加 environment 字段以指定部署环境
- 设置页面 URL 输出变量以便后续使用
- 确保工作流能够正确识别和部署到 GitHub Pages
2025-12-15 21:52:32 +08:00

44 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Deploy Vue Project
on:
push:
branches: [ main ] # 如果你的主分支叫 master请改为 master
permissions:
contents: read
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 检出代码
uses: actions/checkout@v6
- name: 安装 Nodejs
uses: actions/setup-node@v6
with:
node-version: 20 # 建议使用 LTS 版本
cache: 'npm'
- name: 安装 pnpm
run: npm install -g pnpm && pnpm install
- name: 构建前端项目
run: pnpm install && pnpm run build
# 关键步骤:告诉 GitHub Actions 跳过 Jekyll 检查
- name: 配置 Github Pages
uses: actions/configure-pages@v5
- name: 上传构建版
uses: actions/upload-pages-artifact@v4
with:
path: './docs'
- name: 部署到 GitHub Pages
uses: actions/deploy-pages@v4