From 83b5a1c5139b5fe734e9e879c23f316662675d84 Mon Sep 17 00:00:00 2001 From: Aaron Jomy Date: Sun, 15 Nov 2026 19:38:40 +0100 Subject: [PATCH] Skip the image build for changes outside the image. The Image workflow ignores docs/, the root README, licences, git metadata and the Checks workflow, and the build context leaves them out, so such a change cannot alter the image. A README under notebooks/ is served to students and still builds. The Checks workflow runs once per pull request instead of twice. Signed-off-by: Aaron Jomy --- .dockerignore | 5 +++++ .github/workflows/checks.yml | 1 + .github/workflows/image.yml | 20 +++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 53b4d00..82d7f16 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,11 +1,16 @@ .git .github +.gitignore +.gitattributes +.pre-commit-config.yaml build +docs **/.ipynb_checkpoints **/__pycache__ **/.pytest_cache # Files the notebooks write when they run. **/timings +**/runs **/machine.json **/data **/nsys-probes diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e1946bf..68cf873 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,6 +2,7 @@ name: Checks on: push: + branches: [main] pull_request: jobs: diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 819b378..e8eeb4d 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -4,12 +4,30 @@ name: Image # on the self-hosted Brev runner that brev/runner-setup.bash registers. Every run builds the # image, runs the package tests and every notebook in it, starts the Compose stack from it and # pushes it. A pull request is built only when its branch lives in this repository: a fork's -# code never runs on the runner. The latest tag moves on a push to main. +# code never runs on the runner. The latest tag moves on a push to main. A change that touches +# only files outside the image (docs/, the root README, licences, the Checks workflow) builds +# nothing; a README under notebooks/ is served to students, so it still builds. on: push: branches: [main] + paths-ignore: + - README.md + - docs/** + - LICENSE* + - .gitignore + - .gitattributes + - .pre-commit-config.yaml + - .github/workflows/checks.yml pull_request: branches: [main] + paths-ignore: + - README.md + - docs/** + - LICENSE* + - .gitignore + - .gitattributes + - .pre-commit-config.yaml + - .github/workflows/checks.yml workflow_dispatch: inputs: latest: