common add 20250414 #28
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 Hexo to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # 监听的分支,根据需要修改 | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' # 使用的 Node.js 版本 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Generate static files | |
| run: npx hexo generate | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.PERSONAL_TOKEN }} | |
| publish_dir: ./public | |
| publish_branch: gh-pages # 指定部署的分支 |