feat(cli): self-syncing cache — p cache sync, query auto-sync, manifest artifact index
#340
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: CI + Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: rustup show # installs toolchain from rust-toolchain.toml | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-test-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: cargo-test- | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: site/pnpm-lock.yaml | |
| - name: Quality gates # same gates as `just ci` | |
| run: scripts/quality_gates.sh --verbose | |
| deploy: | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: | | |
| rustup show | |
| rustup target add wasm32-unknown-emscripten | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-wasm-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: cargo-wasm- | |
| - name: Cache emsdk | |
| uses: actions/cache@v4 | |
| with: | |
| path: local/emsdk | |
| key: emsdk-latest | |
| - name: Build wasm | |
| run: scripts/build-wasm.sh | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: site/pnpm-lock.yaml | |
| - name: Build site | |
| run: cd site && pnpm install && pnpm run build | |
| - name: Deploy to Cloudflare Pages | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy site/_site --project-name=toolpath --branch=${{ github.head_ref || 'main' }} | |
| - name: Comment preview URL on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = `🔍 **Preview deployed:** ${process.env.DEPLOY_URL}`; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.includes('Preview deployed:')); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } | |
| env: | |
| DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }} |