Build and push images from GitHub Actions - #157
Open
grahamgilbert wants to merge 4 commits into
Open
Conversation
The CircleCI org has no pipeline history at all - every project reads "LAST RUN: Not yet!" and the v2 API returns an empty pipeline list - so tag pushes have not built anything for some time. The 3.4.1 tag on Docker Hub dates from Nov 2022. Replace it with a workflow that pushes macadmins/crypt-server:<tag> on tag pushes and moves :latest on master, then dispatches the crypt-server-saml build, which layers on top of this image. Requires DOCKERHUB_USER, DOCKERHUB_TOKEN and SAML_DISPATCH_TOKEN secrets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docker/run.sh applies migrations at container startup, so a migration that imports cleanly but fails to apply would get published and only break on deploy. The old CircleCI config gated image builds on manage.py migrate; that gate went away with it. Build with load: true instead of pushing directly, run migrate inside the built image, and only push if it succeeds. This checks the artifact that actually ships, rather than a pip install on a different base. With no DB_* env set, docker/settings.py falls back to sqlite, which is what run.sh sees. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CircleCI is not building anything. The org shows
LAST RUN: Not yet!on every project, 0 workflow runs over 30 days, andGET /api/v2/project/gh/grahamgilbert/Crypt-Server/pipelinereturns an empty list. The most recent tag on Docker Hub is3.4.1from November 2022;latestlast moved 2025-01-29, almost certainly by hand.So pushing the
3.4.2tag built nothing. This moves image builds to GitHub Actions.What changed
.github/workflows/docker.yml— on a tag push, build and publishmacadmins/crypt-server:<tag>; on a master push, move:latest. Then dispatch thecrypt-server-samlbuild, which layers on top of this image..circleci/config.ymlandremote_build.py. Both are dead, and if the CircleCI org were ever reconnected itsbuild_latest/build_tagjobs would race this workflow pushing the same tags..circleci/andremote_build.pyentries from.dockerignore.set_build_no.pyis deliberately kept —docs/Development.mddocuments it as a pre-commit hook, andversion.plistis read byfvserver/context_processors.pyandserver/views.py.Migration gate
The build uses
load: trueand pushes only aftermanage.py migratesucceeds inside the built image.docker/run.shapplies migrations at container startup, so a migration that imports cleanly but fails to apply would otherwise be published and break on deploy. With noDB_*env set,docker/settings.pyfalls back to sqlite, which is whatrun.shsees.This is a stronger check than the CircleCI job it replaces: that one tested a fresh
pip installon a different base image, this tests the artifact that actually ships.Required secrets
Nothing will run until these exist:
DOCKERHUB_USER/DOCKERHUB_TOKENmacadminsSAML_DISPATCH_TOKENcontents: writeoncrypt-server-saml(GITHUB_TOKENcannot dispatch cross-repo)Not done here
black --checkalready fails ondocker/settings.pyon master, so adding the gate would block the release on a pre-existing failure. Worth a follow-up: fix the formatting, then add the gate.version.plistis stale at3.4.1.378, so the UI reports the old version. Pre-existing, unrelated to this change.amd64only, matching what shipped before. arm64 via QEMU would roughly double build time.Testing
None of this has executed — the YAML and step structure are validated, and the sqlite fallback verified by reading
docker/settings.pyagainstdocker/run.sh, but the first real run will be in CI. Pairs with grahamgilbert/crypt-server-saml PR.🤖 Generated with Claude Code