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: GitHub Pages Astro CI | |
| on: | |
| # 每次推送到 `main` 分支时触发这个“工作流程” | |
| push: | |
| branches: [ master ] | |
| # 允许你在 GitHub 上的 Actions 标签中手动触发此“工作流程” | |
| workflow_dispatch: | |
| # 允许 job 克隆 repo 并创建一个 page deployment | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout your repository using git | |
| uses: actions/checkout@v4 | |
| - name: Install, build, and upload your site | |
| uses: withastro/action@v5 # 更新为最新的 withastro action 版本 | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 # 已是 v4 版本,确保版本匹配 |