ci(deploy): make API-domain reconciliation opt-in, document the real host layout
The Reconcile tenant API domains step ran on every push to main. On the production host that is actively harmful: api.gorbushka.market already has a hand-written vhost, and configure-api-domain.sh writes its own file per domain - so the step would hand nginx a second server block for a server_name that already has one and re-run certbot against a live API, once per deploy. Shipping frontend files needs none of it. Gate it behind a workflow_dispatch input, off by default, for standing up a NEW base domain. This also shrinks the secrets a normal deploy requires to four (DEPLOY_HOST, DEPLOY_USER, DEPLOY_SSH_KEY, DEPLOY_KNOWN_HOSTS); STOREFRONT_DOMAINS, CERTBOT_EMAIL and BACKEND_UPSTREAM are now read only on the opt-in path. Document the production host as it actually is: provisioned by hand before server-setup.sh existed, per-domain vhosts rooted at /var/www/dexarmarket/browser, which is now a symlink to /srv/marketplaces/current/frontend. Before 2026-08-22 it pointed straight at a pinned release with no `current` in between, so releases14d46ceand98c39f6uploaded successfully and were never served.
This commit is contained in:
15
.github/workflows/deploy.yml
vendored
15
.github/workflows/deploy.yml
vendored
@@ -13,6 +13,15 @@ on:
|
||||
description: Branch or SHA to deploy
|
||||
required: false
|
||||
default: main
|
||||
reconcile_api_domains:
|
||||
description: >-
|
||||
Also provision api.<base-domain> nginx vhosts and TLS. Off by default:
|
||||
existing API domains are configured by hand, and re-running the helper
|
||||
writes a second server block for a server_name that already has one.
|
||||
Turn this on only when adding a NEW base domain.
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: deploy-frontend
|
||||
@@ -82,7 +91,13 @@ jobs:
|
||||
printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
# Opt-in only. api.<base-domain> vhosts already exist and are hand-managed;
|
||||
# the helper writes its own file per domain, so running it unconditionally
|
||||
# would give nginx two server blocks for one server_name and re-run certbot
|
||||
# against a live API on every single deploy. Frontend releases do not need
|
||||
# this step - it is for standing up a NEW base domain.
|
||||
- name: Reconcile tenant API domains
|
||||
if: ${{ inputs.reconcile_api_domains }}
|
||||
env:
|
||||
HOST: ${{ secrets.DEPLOY_HOST }}
|
||||
USER: ${{ secrets.DEPLOY_USER }}
|
||||
|
||||
Reference in New Issue
Block a user