Symbol dispose mechanism (#701) #78
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: π Index Semantic Search (content) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'content/blog/**' | |
| - 'content/pages/**' | |
| - 'content/data/**' | |
| - 'app/routes/**' | |
| - 'app/components/**' | |
| - 'app/root.tsx' | |
| - 'app/other-routes.server.ts' | |
| - 'app/utils/sitemap.server.ts' | |
| - 'other/semantic-search/**' | |
| env: | |
| # Set `SITE_CACHE_VERSION` as a repository variable so all workflows share one | |
| # knob for invalidation. | |
| SITE_CACHE_VERSION: ${{ vars.SITE_CACHE_VERSION }} | |
| NODE_VERSION: 24 | |
| jobs: | |
| index: | |
| name: π Index Semantic Search (content) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: β Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: π₯ Download deps | |
| uses: bahmutov/npm-install@v1.11.2 | |
| - name: π Copy test env vars | |
| run: cp .env.example .env | |
| - name: π¦ Prime Site Cache | |
| id: site-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: other/cache.db | |
| # `other/cache.db` is a derived artifact. Key it off the inputs that can | |
| # make it stale (content + cache/MDX code + deps), not `github.sha`. | |
| key: >- | |
| site-cache-mocks-${{ env.SITE_CACHE_VERSION }}-${{ runner.os | |
| }}-node${{ env.NODE_VERSION }}-${{ hashFiles( | |
| 'package-lock.json', | |
| 'app/utils/cache.server.ts', | |
| 'app/utils/compile-mdx.server.ts', | |
| 'app/utils/github.server.ts', | |
| 'app/utils/markdown.server.ts', | |
| 'app/utils/mdx.server.ts', | |
| 'content/**', | |
| 'mocks/**' | |
| ) }} | |
| restore-keys: | | |
| site-cache-mocks-${{ env.SITE_CACHE_VERSION }}-${{ runner.os }}-node${{ env.NODE_VERSION }}- | |
| - name: π Setup Database (migrations) | |
| if: steps.site-cache.outputs.cache-hit != 'true' | |
| run: npx prisma migrate deploy | |
| - name: π Build (production) | |
| if: steps.site-cache.outputs.cache-hit != 'true' | |
| run: npm run build | |
| - name: π Generate Site Cache | |
| if: steps.site-cache.outputs.cache-hit != 'true' | |
| run: npm run prime-cache:mocks | |
| - name: π Index changed content | |
| run: | | |
| set -euo pipefail | |
| node --env-file=.env other/semantic-search/index-repo-content.ts --before "${{ github.event.before }}" --after "${{ github.sha }}" | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_AI_GATEWAY_ID: ${{ secrets.CLOUDFLARE_AI_GATEWAY_ID }} | |
| CLOUDFLARE_AI_GATEWAY_AUTH_TOKEN: | |
| ${{ secrets.CLOUDFLARE_AI_GATEWAY_AUTH_TOKEN }} | |
| CLOUDFLARE_VECTORIZE_INDEX: ${{ secrets.CLOUDFLARE_VECTORIZE_INDEX }} | |
| CLOUDFLARE_AI_EMBEDDING_MODEL: | |
| ${{ secrets.CLOUDFLARE_AI_EMBEDDING_MODEL }} | |
| R2_BUCKET: ${{ secrets.R2_BUCKET }} |