Skip to content

Commit 0f0f1dd

Browse files
committed
Document build and deployment
1 parent 40fe412 commit 0f0f1dd

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,33 @@ file when the ActiveRecord model object is destroyed.
184184

185185
Besides API endpoints, the [`ImagesController`](app/controllers/images_controller.rb)
186186
is also responsible for streaming the images themselves to the browser — not ideal
187-
for a high-volume application, but good enough for now.
187+
for a high-volume application, but good enough for now and obviates the need for
188+
a separate image server.
188189

189190
## Build, packaging, and deployment
190191

191-
**TO DO**
192+
The GALC API application is built via GitHub actions. The workflow in
193+
[`build.yml`](.github/workflows/build.yml) runs the following jobs on
194+
each push or pull request:
192195

196+
1. `build`: builds a Docker image and pushes it to GitHub's `ghcr.io` repository,
197+
tagged with the short commit hash
198+
2. `test`: if `build` succeeds, pulls the image and runs tests, style checks, etc.
199+
3. `push`: if `test` succeeds, retags the image from (1) with the branch name
200+
(e.g. `main`)
201+
202+
For each GitHub
203+
[release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository),
204+
the workflow in [`release.yml`](.github/workflows/build.yml) uses the short commit
205+
hash associated with the release to find and pull the docker image from step (1)
206+
above, and retags it with:
207+
208+
- a semantic version number taken from the release name (actually, major, minor,
209+
and patch versions — e.g. release 6.5.4 would be tagged note only as `6.5.4` but
210+
also as `6` and `6.5`) and (b) the tag `latest`.
211+
212+
### Deployment
213+
214+
Deployment is triggered manually via the `ops/docker-swarm` Jenkins build. The
215+
staging and production Docker stacks are configured to pull the `main` and `latest`
216+
images, respectively.

0 commit comments

Comments
 (0)