Skip to content

Add CI workflow that builds the podman image#1

Merged
nikicat merged 1 commit into
masterfrom
ci/build-image
Jun 23, 2026
Merged

Add CI workflow that builds the podman image#1
nikicat merged 1 commit into
masterfrom
ci/build-image

Conversation

@nikicat

@nikicat nikicat commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Adds a GitHub Actions workflow that builds the container image with podman and fixes the image build, which was already broken on master.

What's here

.github/workflows/build-image.yml (new)

  • Triggers on push to master, pull requests, and manual dispatch.
  • PR / manual: make image with --layers --cache-from — build-only, no push.
  • master: make push with --layers --cache-from --cache-to — builds, populates the registry cache, and pushes the image + tools image to ghcr.io/nikicat/tg-echo-service.
  • Auth via the built-in GITHUB_TOKEN (no secrets to add). Includes recursive submodule checkout, a disk-cleanup step (the WebRTC build is large), concurrency cancel of superseded runs, and a 6h timeout.

Containerfile — adds COPY video_platform.cpp .. Commit 935f6a7 added that file to the tgcalls target in CMakeLists.txt but never to the Containerfile, so make image failed at configure time. Placed after the TDLib build so editing it doesn't bust the cached TDLib layer.

Makefile — adds an IMAGE_BUILD_ARGS ?= hook injected into the image target's podman build. Empty for local make image; CI passes the cache flags through it, so the build command stays single-sourced.

Why registry cache (not type=gha)

podman has no GHA cache backend; cross-run caching is registry-backed only (podman ≥4.2 --cache-to/--cache-from). Since we already push to GHCR, the cache lives at ghcr.io/nikicat/tg-echo-service/buildcache and keeps the expensive TDLib/tgcalls/WebRTC layers warm between runs.

Notes

  • First master run is a cold build (no cache yet) and creates the GHCR packages (private by default — flip to public in repo settings to allow anonymous pulls).
  • Fork PRs get a read-only token and can't read the private cache, so they fall back to a full build (no hard failure). Same-repo PRs use the cache.
  • The heavy build wasn't run locally; the Containerfile fix is from static analysis of the CMake source list, and this workflow run is the end-to-end check.

🤖 Generated with Claude Code

Adds a GitHub Actions workflow that builds the container image with podman
on push to master, pull requests, and manual dispatch. On master it also
populates a registry-backed layer cache and pushes the image (and tools
image) to GHCR via the built-in GITHUB_TOKEN; PR/manual runs build only.

podman has no GHA cache backend, so cross-run caching uses --cache-to/
--cache-from against ghcr.io/<repo>/buildcache, keeping the expensive
TDLib/tgcalls/WebRTC layers warm between runs.

Also fixes the Containerfile, which never copied video_platform.cpp after
935f6a7 added it to the tgcalls target in CMakeLists.txt, so `make image`
was already broken. Copied after the TDLib build so editing it doesn't bust
the cached TDLib layer. The Makefile gains an IMAGE_BUILD_ARGS hook so CI
injects the cache flags through `make image`/`make push` without diverging
from the local build command.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nikicat
nikicat merged commit 8614d1f into master Jun 23, 2026
1 check passed
@nikicat
nikicat deleted the ci/build-image branch June 23, 2026 07:49
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