- Shell 74.6%
- Dockerfile 25.4%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| actions/build-image | ||
| images/ci-base | ||
| .gitignore | ||
| AGENTS.md | ||
| LICENSE | ||
| README.fr.md | ||
| README.md | ||
Tycho forge-ci
Job images and reusable actions for the CI of a self-hosted forge (Forgejo Actions).
This repository holds recipes and the action that builds them. Upstream, it publishes nothing: each forge forks it, and the fork builds the images and pushes them to the registry of that forge. A forge therefore depends on no image hosted elsewhere, and decides when it moves to a newer version.
| Path | Content |
|---|---|
images/ci-base |
Job image with the usual CI tools already installed (Node.js, Bun, Git LFS, build toolchain, Docker CLI) |
actions/build-image |
Action that builds a recipe, runs its smoke test and publishes it for amd64 and arm64 |
.forgejo/workflows/publish.yml |
Publication workflow, idle until a fork is configured |
Publishing on a forge
-
Fork this repository into an organisation of your forge (or mirror it there when the forge has no access to the upstream one).
-
Set the publication settings of the fork or of its organisation (Settings > Actions):
Kind Name Value Variable IMAGE_REGISTRYRegistry host Secrets REGISTRY_USER,REGISTRY_TOKENAccount allowed to push packages -
Synchronise the fork with upstream. Each push runs the publication workflow:
Branch of the fork Tags published mainX.Y.Z,X.Y,XdevelopX.Y.Z-dev.<short revision>,develop
The image is published as <IMAGE_REGISTRY>/<owner of the fork>/ci-base. A released X.Y.Z is never overwritten: the run ends without publishing when the registry already holds it.
The first run uses the default job image of the runner: the action installs the Docker client it lacks.
The fork carries no change of its own. To move to a newer image, synchronise it with upstream; to stay on a version, do not.
The build-image action
- uses: ./actions/build-image
with:
registry: ${{ vars.IMAGE_REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
| Input | Default | Purpose |
|---|---|---|
image |
ci-base |
Recipe directory under images/ |
registry |
Registry host. Required to publish | |
namespace |
owner of the calling repository | Path under the registry |
username, password |
Account allowed to push. Required to publish | |
push |
true |
false stops after the build and the smoke test |
channel |
release |
release publishes X.Y.Z, X.Y, X and refuses to overwrite X.Y.Z; develop publishes X.Y.Z-dev.<revision> and develop |
if-exists |
fail |
Release channel, version already published: fail, or skip to end without publishing |
platforms |
linux/amd64,linux/arm64 |
Platforms to publish |
source-url |
Value of the org.opencontainers.image.source label |
|
docker-host |
tcp://127.0.0.1:2375 |
Docker endpoint used when DOCKER_HOST is not set |
Outputs: version (read from the recipe) and image (full reference of the published image).
The job needs a Docker daemon it can reach (the DinD sidecar of the runner) that accepts privileged containers, for the emulation of the second architecture.
Development
INPUT_PUSH=false actions/build-image/build-image.sh
builds ci-base for the local architecture and runs its smoke test. The CI of this repository does the same on every pull request.
Licence
AGPL-3.0-only, © Quatrain Technologies.