CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m24s
CI / api (pull_request) Successful in 1m0s
CI / harness (pull_request) Successful in 3m53s
CI / security (pull_request) Successful in 39s
CI / gate (pull_request) Successful in 1s
63 lines
2.1 KiB
Markdown
63 lines
2.1 KiB
Markdown
---
|
|
quick_id: 260613-fp9
|
|
title: ".gitea and .planning pushes should not trigger a docker image publish"
|
|
status: ready
|
|
---
|
|
|
|
# Quick Task 260613-fp9: Skip Docker publish for `.gitea`/`.planning`-only pushes
|
|
|
|
## Problem
|
|
|
|
`.gitea/workflows/publish.yml` triggers on every `push` to `main` with no path
|
|
filter. Two classes of push currently fire a full Docker build + publish that
|
|
produce an identical image:
|
|
|
|
- `.planning/**`-only commits, which push straight to `main` (the `.planning/*`
|
|
branch-protection pattern is unprotected).
|
|
- `.gitea/**`-only changes (CI/workflow edits) merged via PR.
|
|
|
|
Neither changes the shipped artifact — `.dockerignore` already excludes
|
|
`.planning` (and `apps/api/tests`) from the image — so the rebuild is wasted
|
|
runner time and a needless `:latest` re-push / new `:vMILESTONE-<sha>` tag.
|
|
|
|
## Change
|
|
|
|
Add a `paths-ignore` filter to the `push` trigger in `publish.yml`:
|
|
|
|
```yaml
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- '.gitea/**'
|
|
- '.planning/**'
|
|
```
|
|
|
|
Gitea Actions follows GitHub-compatible workflow syntax (the repo already relies
|
|
on the native `branches:` push filter). When every file changed in a push to
|
|
`main` matches a `paths-ignore` glob, the `publish` job is skipped. A push that
|
|
also touches code/Dockerfile/manifests still triggers publish — correct.
|
|
|
|
Also update the header comment block to document the new skip behavior.
|
|
|
|
## Tasks
|
|
|
|
1. **Edit `.gitea/workflows/publish.yml`**
|
|
- files: `.gitea/workflows/publish.yml`
|
|
- action: Add `paths-ignore: ['.gitea/**', '.planning/**']` under `on.push`;
|
|
update the top-of-file `# Trigger:` comment to note doc/CI-only pushes skip.
|
|
- verify: `paths-ignore` present under `on.push`; YAML still parses; the
|
|
existing `--target production` self-assertion grep still matches.
|
|
- done: pushes touching only `.gitea/**` and/or `.planning/**` no longer
|
|
trigger the publish job; mixed pushes (code + docs) still publish.
|
|
|
|
## must_haves
|
|
|
|
- truths:
|
|
- publish.yml `on.push` carries a `paths-ignore` listing `.gitea/**` and `.planning/**`
|
|
- `branches: [main]` is retained
|
|
- artifacts:
|
|
- `.gitea/workflows/publish.yml`
|
|
- key_links:
|
|
- `.gitea/workflows/publish.yml`
|