Deploy production from Diffinery (#15)
Deploy and the live test now run on diffinery.com's hosted runners. GitHub mirrors the repository there through the sync workflow, and a manual Deploy run on GitHub still deploys as a fallback. Claude-Session: https://claude.ai/code/session_01AizKXSsengXZRegJxRATkL Co-authored-by: Claude <noreply@anthropic.com>
Canberk Demirci authored · GitHub committed signed1 parent 7a1eadccommit bcf1e7f7bb06e12fff8964cec24dbc0adaaac6cfBrowse files
3 files changed+14−6
modified.github/workflows/deploy.yml+4−4View file
| @@ -18,10 +18,10 @@ | ||
| 18 | 18 | jobs: |
| 19 | 19 | deploy: |
| 20 | 20 | name: Deploy to Cloudflare |
| 21 | - # Production deploys from one host only. This repository is mirrored to | |
| 22 | - # diffinery.com (see sync-to-diffinery.yml); switch this to | |
| 23 | - # 'https://diffinery.com' to make Diffinery the one that deploys. | |
| 24 | - if: ${{ github.server_url == 'https://github.com' }} | |
| 21 | + # Production deploys from Diffinery, on its own hosted runners. GitHub | |
| 22 | + # mirrors this repository there (see sync-to-diffinery.yml); running this | |
| 23 | + # workflow by hand on GitHub still deploys, as a fallback. | |
| 24 | + if: ${{ github.server_url == 'https://diffinery.com' || github.event_name == 'workflow_dispatch' }} | |
| 25 | 25 | runs-on: ubuntu-latest |
| 26 | 26 | timeout-minutes: 45 |
| 27 | 27 | environment: |
modified.github/workflows/live-test.yml+1−1View file
| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | live: |
| 26 | 26 | name: Containers, sandboxes, webhooks, schedules and LFS |
| 27 | 27 | # Runs on the host that deploys production (see the gate in deploy.yml). |
| 28 | - if: ${{ github.server_url == 'https://github.com' && (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success') }} | |
| 28 | + if: ${{ github.event_name == 'workflow_dispatch' || (github.server_url == 'https://diffinery.com' && github.event.workflow_run.conclusion == 'success') }} | |
| 29 | 29 | runs-on: ubuntu-latest |
| 30 | 30 | timeout-minutes: 30 |
| 31 | 31 | env: |
modifiedREADME.md+9−1View file
| @@ -48,7 +48,15 @@ | ||
| 48 | 48 | |
| 49 | 49 | ## Deploying |
| 50 | 50 | |
| 51 | -Deploys run from GitHub Actions on every push to `main` (`.github/workflows/deploy.yml`). | |
| 51 | +Diffinery deploys itself: this repository lives at | |
| 52 | +`diffinery.com/codician-team/diffinery`, and every push to `main` there runs | |
| 53 | +`.github/workflows/deploy.yml` on Diffinery's hosted runners, followed by the | |
| 54 | +live test (`.github/workflows/live-test.yml`). GitHub stays the upstream for | |
| 55 | +now: `.github/workflows/sync-to-diffinery.yml` copies every branch and tag, and | |
| 56 | +the secrets and variables below, to Diffinery on each push, then waits for the | |
| 57 | +Actions runs there and fails if any of them fail. Running Deploy by hand on | |
| 58 | +GitHub still deploys, as a fallback. | |
| 59 | + | |
| 52 | 60 | The workflow needs two repository secrets: |
| 53 | 61 | |
| 54 | 62 | - `CLOUDFLARE_API_TOKEN`: account permissions Workers Scripts, D1, R2, |