Skip to content

feat(ci): build afp image on GitHub Actions and push to GHCR - #5

Merged
Andreas-Garcia merged 2 commits into
developfrom
feature/ghcr-image-build
Sep 28, 2026
Merged

Andreas-Garcia merged 2 commits into
developfrom
feature/ghcr-image-build

Conversation

@Andreas-Garcia

Copy link
Copy Markdown
Member

Description

Moves the afp image build off the CPU-overloaded BTMT VPS. The new .github/workflows/build-and-deploy.yml builds the Docker image on ubuntu-latest (this repo is public, so the minutes are free), pushes it to ghcr.io/behindthemusictree/afp, then triggers the Coolify deploy of the afp app through BehindTheMusicTree/github-workflows/.github/actions/trigger-coolify-deploy@v4.3.4, which then health-checks /health.

  • Tags: :staging on develop, :prod on main, and :sha-<short> on every push. Coolify will deploy the moving staging / prod tag.
  • Deploy target: Coolify afp app, environment staging (develop) or production (main). Both environments exist in the infrastructure repo.
  • Runs are serialized per ref (cancel-in-progress: false). Build caching uses the GHA cache.
  • Dockerfile: the build args are gone, so one prebuilt image works in every environment. The FLASK_LOG_*_FILENAME / GUNICORN_LOG_*_FILENAME variables are now read at runtime. settings.py and scripts/setup-filesystem.sh already fail fast when they are missing, and Coolify already injects them at runtime (is_runtime: true). FPCALC is baked in as /app/bin/fpcalc, the path where the image itself puts the binary.

Related Issues

N/A. Part of the BTMT "build public-repo images on GitHub Actions" plan. The infrastructure follow-up will switch the Coolify afp app source to the GHCR image and move the log filenames from buildtime_env to static_env.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test addition/update
  • CI/CD or infrastructure change

Pre-PR Checklist

Code Quality

  • Code follows existing project style and structure
  • No unnecessary dependencies or debug code left in
  • Removed commented-out code
  • No hardcoded credentials, API keys, or secrets

Tests

  • All tests pass (no Python changes; the Tests workflow runs on this PR)
  • New features have corresponding tests (N/A: CI/Dockerfile only)
  • Bug fixes include regression tests (N/A)
  • Tests run successfully with proper environment setup (FPCALC, env vars)

Documentation

  • CHANGELOG.md updated in the [Unreleased] section for any notable change
  • README.md updated if adding new features or changing behavior
  • Environment variable documentation updated if config changed
  • Added/updated type hints where appropriate (N/A)

Git Hygiene

  • Commit messages are concise and clear
  • Prefer small, focused commits (one logical change per commit)
  • No merge conflicts with target branch (develop, or main for hotfixes)
  • Branch is up to date with the target branch
  • No accidental commits (large files, secrets, personal configs)

Breaking Changes

  • This PR includes breaking changes
  • Breaking changes are clearly documented below
  • Migration path is provided (if applicable)

Breaking Changes Description

N/A. Anyone running docker build by hand no longer passes --build-arg, and must now pass the log filename variables with -e at runtime (see the README). Coolify already provides them at runtime.

Testing Instructions

How to Test

  1. actionlint .github/workflows/build-and-deploy.yml passes.
  2. After merging to develop, the "Build and deploy" run succeeds, ghcr.io/behindthemusictree/afp:staging exists, and the afp staging deploy passes its /health check.
  3. After releasing to main, :prod exists and the production deploy succeeds.

Test Results

actionlint: clean.

Additional Context

Until the infrastructure follow-up lands, Coolify keeps building afp from git, so the triggered deploy still builds on the VPS. This is expected and temporary.

Checklist for Reviewers

  • Code follows project conventions and style
  • Logic is sound and well-structured
  • Error handling is appropriate
  • CI tests pass (tests workflow runs successfully)
  • Tests are adequate for the changes
  • API changes are documented (if applicable)
  • Breaking changes are clearly marked and documented
  • All review comments are addressed
  • No unresolved discussions

🤖 Generated with Claude Code

…y deploy

Builds ghcr.io/behindthemusictree/afp on ubuntu-latest (:staging on develop,
:prod on main, :sha-<short>) and triggers the afp Coolify deploy, moving image
builds off the VPS. Dockerfile drops its build args so one image serves every
environment; log filenames become runtime env, FPCALC is baked in.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Andreas-Garcia
Andreas-Garcia merged commit f0207e2 into develop Sep 28, 2026
1 check passed
@Andreas-Garcia
Andreas-Garcia deleted the feature/ghcr-image-build branch September 28, 2026 21:09

This branch was successfully deployed

1 active deployment
CI_TEST — 675178b4 Deployed Sep 28, 2026 by Andreas-Garcia via Tests #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant