This repository was archived by the owner on Nov 12, 2025. It is now read-only.
fix: build配置 #471
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 Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - '!release-please*' | |
| pull_request_target: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| if: "!startsWith(github.head_ref, 'release-please')" | |
| runs-on: ubuntu-22.04 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| outputs: | |
| app_token: ${{ steps.app_token.outputs.token }} | |
| steps: | |
| - name: 检出仓库 | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request_target.head.ref || github.ref_name }} | |
| - name: 获取token | |
| uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: 获取用户ID | |
| id: get-user-id | |
| run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: 设置 pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.13.2 | |
| run_install: | | |
| - args: [--no-frozen-lockfile] | |
| - name: 构建 | |
| run: | | |
| pnpm build:docs | |
| - name: 上传构建产物 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-neko-kit | |
| path: docs/.vuepress/dist | |
| deploy-to-cloudflare-pages: | |
| runs-on: ubuntu-22.04 | |
| needs: [build] | |
| steps: | |
| - name: 导入构建产物 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: git-neko-kit | |
| path: ./ | |
| - name: 获取token | |
| uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: 部署到 Cloudflare Pages | |
| id: deploy-cloudflare-pages | |
| uses: AdrianGonz97/refined-cf-pages-action@v1 | |
| with: | |
| apiToken: ${{ secrets.CF_TOKEN }} | |
| accountId: ${{ secrets.CF_ID }} | |
| githubToken: ${{ steps.app-token.outputs.token }} | |
| projectName: 'git-neko-kit' | |
| directory: '.' | |
| deploymentName: cloudflare-pages | |
| wranglerVersion: '3.114.9' | |
| deploy-to-deno-pages: | |
| runs-on: ubuntu-22.04 | |
| needs: [build] | |
| steps: | |
| - name: 导入构建产物 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: git-neko-kit | |
| path: ./ | |
| - name: 部署到 Deno Pages | |
| uses: denoland/deployctl@v1 | |
| with: | |
| project: git-neko-kit | |
| entrypoint: jsr:@std/http/file-server | |