name: deploy-site on: push: branches: - dev - production workflow_dispatch: concurrency: group: deploy-site-${{ github.ref_name }} cancel-in-progress: false permissions: contents: read jobs: deploy: if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production') runs-on: blacksmith-4vcpu-ubuntu-2404 environment: ${{ github.ref_name }} steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: ./.github/actions/setup-bun # The workflow's own token, at build time only: script/github-snapshot.ts records the repo # numbers and releases the site falls back to. The Worker never gets a GitHub token. - name: Build working-directory: services/site run: bun script/build.ts --mode ${{ github.ref_name }} env: GITHUB_TOKEN: ${{ github.token }} - name: Deploy working-directory: services/site run: bunx cf deploy --prebuilt --mode ${{ github.ref_name }} env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}