Skip to content

Commit 9b49300

Browse files
committed
docs(ci): document reusable workflows and hosted-first self-hosted fallback (PR #48)
1 parent a7dfa36 commit 9b49300

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

docs/ci.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# CI workflows (overview)
22

3-
The repository uses GitHub Actions. The active workflows are in `.github/workflows/` — check those files for exact steps. High-level:
3+
The repository uses GitHub Actions. The active workflows live in `.github/workflows/` — check those files for exact steps. Recent CI changes extract common logic into reusable workflows to allow a hosted-first runner strategy with a self-hosted fallback. High-level:
44

5-
- `check.yml` — runs lint, commitlint, and the test suite on pushes and PRs.
6-
- `docker.yml`builds and pushes container images for PRs and pushes.
7-
- `release.yml`run by `release-please` on `main` to automate releases and production image publishing.
5+
- `check.yml`top-level caller that invokes the reusable workflow in `check-reusable.yml`; runs lint, commitlint, and the test suite on pushes and PRs. The caller prefers GitHub-hosted runners and will fall back to a self-hosted runner only if the hosted job fails.
6+
- `docker.yml`top-level caller that invokes `docker-reusable.yml` to build and push container images.
7+
- `release.yml`caller for `release-reusable.yml`; invoked by `release-please` on `main` to automate releases and image publishing.
88

9-
When a check fails, open the corresponding workflow run in GitHub (Actions tab) to see job logs.
9+
Key notes about the hosted-first / self-hosted fallback:
10+
11+
- The top-level workflow will try a hosted runner first and, if that job fails, run a fallback job targeting `self-hosted` runners. This improves reliability when hosted runners are unavailable or hit capacity.
12+
- The fallback uses a `failure()` condition so it only runs when the primary (hosted) job fails; this can cause duplicated checks to appear in the PR UI and may show cosmetic failures for the fallback run — this is expected and documented in the workflow comments.
13+
- `continue_on_error` is exposed as an input and applied at the reusable workflow job level when requested.
14+
15+
When a check fails, open the corresponding workflow run in GitHub (Actions tab) to see job logs. Prefer inspecting the primary (hosted) job logs first.
1016

1117
Avoid committing generated artifacts — have CI produce and publish them instead.

docs/docker-and-deployment.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Docker & Deployment
22

3+
34
This guide explains how to build and run the project's Docker image and where CI builds/publishes images.
45

56
## Provided Dockerfile
67

7-
A `Dockerfile` exists at the repository root. It is used by the CI workflow `.github/workflows/docker.yml` to build multi-tag images and push them to the configured registry (default: `ghcr.io`).
8+
A `Dockerfile` exists at the repository root. CI image build/publish logic has been extracted into a reusable workflow (`.github/workflows/docker-reusable.yml`) and is invoked by a small top-level caller (`.github/workflows/docker.yml`) that prefers hosted runners and falls back to `self-hosted` when the hosted job fails.
89

910
## Local build & run
1011

@@ -22,14 +23,15 @@ Replace `--env-file .env.example` with your `.env` file or explicit `-e` flags f
2223

2324
## CI image publishing
2425

25-
The repository's `docker.yml` workflow builds and pushes images to the registry. The workflow:
26+
27+
The repository's `docker.yml` top-level caller invokes the reusable workflow to build and push images to the registry. The reusable workflow:
2628

2729
- sets up QEMU and Buildx
2830
- logs into the registry using the workflow token
2931
- generates metadata tags (sha, branch/ref, test)
3032
- builds and pushes the image(s)
3133

32-
If you need to change the target registry or image name, update the `REGISTRY` and `IMAGE_NAME` environment variables in the workflow.
34+
If you need to change the target registry or image name, update the `REGISTRY` and `IMAGE_NAME` environment variables in the reusable workflow or the top-level caller as appropriate.
3335

3436
## Deployment notes
3537

docs/release.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Release automation (summary)
22

3-
Releases are produced by `googleapis/release-please-action` in `.github/workflows/release.yml`.
43

5-
- Trigger: push to `main`.
4+
Releases are produced by `googleapis/release-please-action`. The release workflow now uses a reusable workflow (`.github/workflows/release-reusable.yml`) and a small top-level caller (`.github/workflows/release.yml`) that prefers GitHub-hosted runners and falls back to a `self-hosted` runner when necessary.
5+
6+
- Trigger: push to `main` (via `release-please` outputs).
67
- Behavior: `googleapis/release-please-action` parses Conventional Commits and will open/update Release PRs or create a release when appropriate; it also generates/updates the changelog (`CHANGELOG.md`) and exposes outputs such as `release_created`, `major`, `minor`, `patch`, `tag_name`, and `body`.
7-
- CI integration: the workflow uses those outputs to tag versions and to build/push container images (see the repo's workflow for the exact steps).
8+
- CI integration: the reusable workflow consumes those outputs to tag versions and to build/push container images (see the repository workflows for exact steps). The hosted-first / self-hosted fallback may cause duplicate PR checks to appear when the fallback runs — this is cosmetic.
89

910
## Notes for maintainers
1011

0 commit comments

Comments
 (0)