CI: roll out into /home/adamf/deploy/stpweb
The site's deploy directory moved from web_server to stpweb with the repo rename, so the publish job's roll-out step failed after pushing the image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# ci.yaml — test every push; publish an image for pushes to main that pass.
|
# ci.yaml — test every push; publish an image for pushes to main that pass.
|
||||||
#
|
#
|
||||||
# Modelled on job-tracker's ci.yaml and run by the same runner: a self-hosted
|
# Modelled on job-tracker's ci.yaml and run by the same runner: a self-hosted
|
||||||
# act_runner on the web_server host (stpvm) in HOST mode, with git and docker and no other
|
# act_runner on the stpweb host (stpvm) in HOST mode, with git and docker and no other
|
||||||
# toolchain. So Go runs in a `docker run` container, and the source is
|
# toolchain. So Go runs in a `docker run` container, and the source is
|
||||||
# fetched with plain git rather than actions/checkout (which needs Node on
|
# fetched with plain git rather than actions/checkout (which needs Node on
|
||||||
# the host).
|
# the host).
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
# typecheck and build, in a node container.
|
# typecheck and build, in a node container.
|
||||||
# publish main only, after test: builds deploy/Dockerfile, pushes it to
|
# publish main only, after test: builds deploy/Dockerfile, pushes it to
|
||||||
# this Gitea's container registry as :<sha> and :latest, then
|
# this Gitea's container registry as :<sha> and :latest, then
|
||||||
# pulls it into the web_server stack (its `activity-tracker`
|
# pulls it into the stpweb stack (its `activity-tracker`
|
||||||
# service) and waits for it to be healthy.
|
# service) and waits for it to be healthy.
|
||||||
#
|
#
|
||||||
# SECRETS (repo settings -> Actions -> Secrets)
|
# SECRETS (repo settings -> Actions -> Secrets)
|
||||||
@@ -136,11 +136,11 @@ jobs:
|
|||||||
run: rm -rf "$SRC"
|
run: rm -rf "$SRC"
|
||||||
|
|
||||||
# Put the new image live, exactly as job-tracker does: pull and
|
# Put the new image live, exactly as job-tracker does: pull and
|
||||||
# recreate only this service, under .compose.lock, which web_server's
|
# recreate only this service, under .compose.lock, which stpweb's
|
||||||
# deploy and maintenance hold while they run compose. A pinned
|
# deploy and maintenance hold while they run compose. A pinned
|
||||||
# ACTIVITY_TRACKER_IMAGE_TAG in the site's .env makes this a no-op.
|
# ACTIVITY_TRACKER_IMAGE_TAG in the site's .env makes this a no-op.
|
||||||
- name: Roll the site onto the new image
|
- name: Roll the site onto the new image
|
||||||
working-directory: /home/adamf/deploy/web_server
|
working-directory: /home/adamf/deploy/stpweb
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Put the service behind your reverse proxy (Caddy, Traefik and so on) for TLS, be
|
|||||||
|
|
||||||
### Deploying to stpvm
|
### Deploying to stpvm
|
||||||
|
|
||||||
Pushing to `main` on Gitea (`adamf/ccp`) runs `.gitea/workflows/ci.yaml` on the web_server host's runner. The workflow runs the tests, pushes `adam-french.co.uk/adamf/activity-tracker:<sha>` and `:latest` to Gitea's container registry, and recreates the `activity-tracker` service in the web_server stack. The service is served at `https://www.adam-french.co.uk/tracker/`, so set collectors to `TRACKER_URL=https://www.adam-french.co.uk/tracker`. Use the `www` host because the apex redirect would turn uploaded POSTs into GETs. To hold a version, set `ACTIVITY_TRACKER_IMAGE_TAG` to a sha in web_server's `.env`.
|
Pushing to `main` on Gitea (`adamf/ccp`) runs `.gitea/workflows/ci.yaml` on stpvm's runner. The workflow runs the tests, pushes `adam-french.co.uk/adamf/activity-tracker:<sha>` and `:latest` to Gitea's container registry, and recreates the `activity-tracker` service in the stpweb stack. The service is served at `https://www.adam-french.co.uk/tracker/`, so set collectors to `TRACKER_URL=https://www.adam-french.co.uk/tracker`. Use the `www` host because the apex redirect would turn uploaded POSTs into GETs. To hold a version, set `ACTIVITY_TRACKER_IMAGE_TAG` to a sha in stpweb's `.env`.
|
||||||
|
|
||||||
The repo needs the `REGISTRY_USER` and `REGISTRY_TOKEN` Actions secrets, the same ones job-tracker uses. Create its database role once on the host:
|
The repo needs the `REGISTRY_USER` and `REGISTRY_TOKEN` Actions secrets, the same ones job-tracker uses. Create its database role once on the host:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user