chore: deploy config node version #2
This file contains hidden or 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 Next.js to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # 触发工作流的分支 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' # 根据需要设置 Node.js 版本 | |
| - name: Install dependencies | |
| run: npm install -g pnpm && pnpm install | |
| - name: Build and export | |
| run: pnpm run build && pnpm run export | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./out |