Deploy to GitHub Pages #506
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 to GitHub Pages | |
| on: | |
| # 每次推送到 `master` 分支时触发这个“工作流程” | |
| # 如果你使用了别的分支名,请按需将 `master` 替换成你的分支名 | |
| push: | |
| branches: [master] | |
| schedule: | |
| - cron: "0 20 * * *" # 每天凌晨 4 点 (北京时间)执行 | |
| # 允许你在 GitHub 上的 Actions 标签中手动触发此“工作流程” | |
| workflow_dispatch: | |
| # 允许 job 克隆 repo 并创建一个 page deployment | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| env: | |
| PATH_MODULE: pinyin # 以拼音路径形式构建 | |
| STEAM_ID: ${{ secrets.STEAM_ID }} | |
| STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }} | |
| ENABLE_REQUEST: "true" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout your repository using git | |
| uses: actions/checkout@v6 | |
| - name: Install, build, and upload your site output | |
| uses: withastro/action@v6 | |
| with: | |
| # path: . # The root location of your Astro project inside the repository. (optional) | |
| node-version: 24 # The specific version of Node that should be used to build your site. Defaults to 24. (optional) | |
| # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) | |
| # build-cmd: pnpm run build # The command to run to build your site. Runs the package build script/task by default. (optional) | |
| # out-dir: dist # The output directory created by the build command. Defaults to dist. (optional) | |
| 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 |