first commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main # 使用你的主分支名 | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 # 使用最新版本的 checkout | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 # 使用最新版本的 setup-node | |
with: | |
node-version: 'lts/*' # 使用 Node.js 的最新 LTS 版本 | |
- name: List directory for debugging | |
run: ls -a | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies with pnpm | |
run: cd pjallcate_frontend && pnpm install | |
- name: Build project with pnpm | |
run: cd pjallcate_frontend && pnpm run build-only | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 # 使用最新版本的 actions-gh-pages | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./pjallcated_frontend/dist # 确保指向正确的构建输出目录 | |
publish_branch: gh-pages |