Deploy every push to main once CI passes, on GitHub too
Drops the DEPLOY_ON_PUSH gate: GitHub is now where this repository deploys from, so a push to main there deploys like one on Diffinery.
2 files changed+4−8
modified.github/workflows/deploy.yml+3−7View file
| @@ -7,7 +7,6 @@ | ||
| 7 | 7 | # DIFFINERY_ZONE the Cloudflare zone for the route (default: the domain's last two labels) |
| 8 | 8 | # MAIL_DOMAIN sends from notifications@<MAIL_DOMAIN> (default DIFFINERY_DOMAIN) |
| 9 | 9 | # ACCESS_TEAM_DOMAIN e.g. example.cloudflareaccess.com |
| 10 | -# DEPLOY_ON_PUSH "true" deploys every push to main on GitHub too (Diffinery always does) | |
| 11 | 10 | # |
| 12 | 11 | # It deploys a main commit only once CI (typecheck, unit tests and the Worker bundle) has |
| 13 | 12 | # passed on it, so it doesn't run those itself. End-to-end tests run alongside the deploy. |
| @@ -33,12 +32,9 @@ | ||
| 33 | 32 | jobs: |
| 34 | 33 | gate: |
| 35 | 34 | name: Main's current tip |
| 36 | - # Production deploys from Diffinery itself, on its own hosted runners (any | |
| 37 | - # Diffinery, so self-hosted copies deploy themselves too). Running this | |
| 38 | - # workflow by hand on GitHub still deploys, as a fallback. On GitHub, pushes to | |
| 39 | - # main deploy only when the repository variable DEPLOY_ON_PUSH is "true", so a | |
| 40 | - # mirror of a repository that deploys elsewhere never deploys twice. | |
| 41 | - if: ${{ github.event_name == 'workflow_dispatch' || ((github.server_url != 'https://github.com' || vars.DEPLOY_ON_PUSH == 'true') && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') }} | |
| 35 | + # Every push to main deploys once CI passes on it, on GitHub or on a Diffinery | |
| 36 | + # instance, and so does running this workflow by hand. | |
| 37 | + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') }} | |
| 42 | 38 | runs-on: ubuntu-latest |
| 43 | 39 | timeout-minutes: 5 |
| 44 | 40 | outputs: |
modifiedapps/diffinery/docs/self-hosting/deploy.md+1−1View file
| @@ -68,7 +68,7 @@ | ||
| 68 | 68 | - `DIFFINERY_ZONE`, if the Cloudflare zone that holds your hostname is not its last two labels. For `git.example.com` the default zone is `example.com`, which is right; for `git.example.co.uk` the default would be `co.uk`, so set `DIFFINERY_ZONE` to `example.co.uk`. |
| 69 | 69 | - `MAIL_DOMAIN`, if email should come from another domain than your hostname, for example `example.com` to send from `[email protected]`. |
| 70 | 70 | |
| 71 | -The Deploy job runs on every push to `main` when your copy lives on a Diffinery instance, and whenever you start it by hand. On GitHub it runs on pushes to `main` only when the repository variable `DEPLOY_ON_PUSH` is `true` (Settings > Secrets and variables > Actions > Variables), after the CI workflow passes on that commit. Without it, start the workflow by hand there (`workflow_dispatch`). Leave `DEPLOY_ON_PUSH` unset on a GitHub mirror of a repository that already deploys from Diffinery, or both would deploy. | |
| 71 | +The Deploy job runs on every push to `main` once the CI workflow passes on that commit, on GitHub or on a Diffinery instance, and whenever you start it by hand (`workflow_dispatch`). A GitHub mirror of a repository that already deploys from Diffinery would deploy too, so keep Actions or the Cloudflare secrets off on such a mirror. | |
| 72 | 72 | |
| 73 | 73 | The workflow doesn't pass `BOOTSTRAP_ADMINS`. Set the list with a first deploy from your machine (`scripts/setup.sh`), or put it under `vars` in your copy's `wrangler.jsonc`; after that, workflow deploys keep it. |
| 74 | 74 |