chore: 改为仅用 master 部署,构建输出到根目录 dist #3
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 VuePress to GitHub Pages | |
| on: | |
| push: | |
| branches: [master] | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build VuePress | |
| run: npm run docs:build | |
| - name: Deploy to master (dist) | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add dist | |
| git diff --staged --quiet || git commit -m "chore: deploy VuePress to master" | |
| git push origin master |