cron #21
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: cron | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Every Sunday at midnight UTC | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| - name: Install Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Install deployctl | |
| run: deno install -gArf jsr:@deno/deployctl | |
| - name: Install latest usage data | |
| run: | | |
| deno install --no-lock npm:caniuse-lite | |
| deno --allow-net --allow-write=data scripts/fetch-statscounter.ts | |
| deno --allow-net --allow-write=data scripts/fetch-useragents-me.ts | |
| deno fmt data | |
| - name: Add CANIUSE_AS_OF_EPOCH to .env | |
| run: deno scripts/print-as-of-env.ts | tee -a .env | |
| - name: Build | |
| run: deno task build | |
| - name: Deploy to Production | |
| run: deployctl deploy --prod --token=${{ secrets.DENO_DEPLOY_TOKEN }} |