name: Deploy site # Builds site/ and publishes it to Cloudflare as the Worker in site/wrangler.jsonc, served at https://imagefast.dev. # Needs two repository secrets: CLOUDFLARE_API_TOKEN ("Edit Cloudflare Workers" template, limited to the account and # the imagefast.dev zone) and CLOUDFLARE_ACCOUNT_ID. on: push: branches: [main] # The demo on the page is built from src/, so library changes redeploy it too. paths: [site/**, src/**, package.json, bun.lock, .github/workflows/deploy-site.yml] workflow_dispatch: permissions: contents: read # One deploy at a time; a newer push waits for the running one instead of racing it. concurrency: deploy-site jobs: deploy: if: github.repository == 'smart-byte/imagefast' # forks have no Cloudflare secrets runs-on: ubuntu-latest environment: name: production url: https://imagefast.dev steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version-file: .nvmrc - uses: oven-sh/setup-bun@v2 with: bun-version: 1.3.5 - run: bun install --frozen-lockfile - run: npm run site:build - uses: cloudflare/wrangler-action@v4 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} wranglerVersion: 4.159.0 # the version site/wrangler.jsonc was checked with (`wrangler deploy --dry-run`) workingDirectory: site command: deploy