Feat(utils): Update cryptography functions (#254) #220
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 CDN Canary | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| concurrency: | |
| group: cdn-canary | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| env: | |
| CDN_CHANNEL: canary | |
| run: npm run build | |
| - name: Build vendor CDN | |
| env: | |
| CDN_CHANNEL: canary | |
| run: npm run build:vendor-cdn | |
| - name: Build CDN assets | |
| env: | |
| CDN_CHANNEL: canary | |
| run: npm run build:cdn-assets | |
| - name: Check for bare imports | |
| run: node tools/cdn/check-bare-imports.js | |
| - name: Worker unit tests | |
| run: cd tools/cdn && npx vitest run --config vitest.unit.config.js | |
| - name: Upload canary to R2 | |
| env: | |
| R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }} | |
| R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }} | |
| run: cd tools/cdn && node upload.js --version canary --force-vendor | |
| - name: Deploy Worker | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: cd tools/cdn && npx wrangler deploy | |
| - name: Purge Cloudflare cache | |
| continue-on-error: true | |
| run: | | |
| curl -sf -X POST \ | |
| "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \ | |
| -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_WORKERS_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"purge_everything":true}' | |
| - name: Cache Playwright | |
| uses: actions/cache@v5 | |
| with: | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} | |
| path: ~/.cache/ms-playwright | |
| - name: Install Playwright | |
| run: cd tools/cdn && npx playwright install chromium | |
| - name: Post-deploy CDN smoke tests | |
| run: cd tools/cdn && npx vitest run --config vitest.config.js |