From 86f14ad68a454f5136b180eb0704c0ee9738793b Mon Sep 17 00:00:00 2001 From: Emma Thorpe Date: Fri, 12 Jun 2026 11:38:30 +0100 Subject: [PATCH] ci: only build when image-affecting files change Add path filters so the workflow runs only when the Dockerfile, nginx config, site assets or .dockerignore change. CI-config, Renovate-config and docs changes (such as a Renovate bump of a CI action) no longer trigger a build or release. workflow_dispatch is added for manual runs after pipeline changes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/build-and-publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitea/workflows/build-and-publish.yml b/.gitea/workflows/build-and-publish.yml index a604c8a..fa62493 100644 --- a/.gitea/workflows/build-and-publish.yml +++ b/.gitea/workflows/build-and-publish.yml @@ -1,10 +1,31 @@ name: Build and publish container +# Only run when files that affect the built image change. Updates to CI +# config, Renovate config, or docs (e.g. a Renovate bump of the checkout +# action) do not change the image and so do not trigger a build or release. +# Use workflow_dispatch to run manually after a pipeline change. on: push: branches: [main] + paths: + - 'Dockerfile' + - 'default.conf' + - 'index.html' + - 'styles.css' + - 'script.js' + - 'messages.js' + - '.dockerignore' pull_request: branches: [main] + paths: + - 'Dockerfile' + - 'default.conf' + - 'index.html' + - 'styles.css' + - 'script.js' + - 'messages.js' + - '.dockerignore' + workflow_dispatch: defaults: run: