name: Deploy on: push: branches: [main] # Fired by sharpemu/sharpemu when a release is published, so the downloads # page picks it up without waiting for the next commit here. repository_dispatch: types: [release-published] # Safety net: rebuild daily in case a dispatch is ever missed. schedule: - cron: '30 4 * * *' workflow_dispatch: concurrency: group: deploy cancel-in-progress: false jobs: deploy: runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 22 cache: npm - run: npm ci - run: npm run build env: # avoids anonymous rate limits on the /downloads releases fetch GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to Cloudflare Pages uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: pages deploy dist --project-name=sharpemu --branch=main