Skip to content

Commit 972471b

Browse files
committed
workflow update
1 parent 8bbe5a0 commit 972471b

5 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/site.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ on:
55
branches:
66
- main
77
- master
8+
paths:
9+
- "bibliography/publications.bib"
810
pull_request:
911
branches:
1012
- main
1113
- master
14+
paths:
15+
- "bibliography/publications.bib"
1216
workflow_dispatch:
1317

1418
concurrency:

DEVELOPMENT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Add a regression test whenever a content mistake causes a build failure. For exa
7272

7373
## GitHub Actions workflow
7474

75-
`.github/workflows/site.yml` runs on pushes and pull requests targeting `main` or `master`, and can be started manually.
75+
`.github/workflows/site.yml` runs automatically only when `bibliography/publications.bib` changes in a push or pull request targeting `main` or `master`. It can also be started manually with **Run workflow** in GitHub Actions.
7676

7777
The build job:
7878

@@ -88,6 +88,8 @@ The deploy job runs only outside pull requests and publishes the artifact to the
8888

8989
In repository **Settings → Pages**, set the publishing source to **GitHub Actions**. The workflow supports either `main` or `master` as the default branch.
9090

91+
Because the workflow is path-limited, changes that do not modify `bibliography/publications.bib` do not start an automatic Pages deployment. After a news, people, CSS, layout, or other site-only update, start this workflow manually unless a separate general site-deployment workflow is configured.
92+
9193
A commit created by `GITHUB_TOKEN` does not need a second workflow run: the active run builds and deploys from the regenerated working tree after committing it.
9294

9395
## Editing publication sources in GitHub

PUBLICATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Keys must match `^[A-Za-z][A-Za-z0-9]*$`, be unique without regard to filename c
7070

7171
6. Commit the BibTeX, sidecar, generated `_papers` record, and `pub.bib`.
7272

73-
The GitHub Actions workflow performs the same generation and will commit changed generated files after a direct push.
73+
When `bibliography/publications.bib` changes, the GitHub Actions workflow performs the same generation and commits changed generated files after a direct push. The workflow can also be started manually.
7474

7575
## Minimal sidecar
7676

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ scripts/build_site.sh
4646

4747
## Automated deployment
4848

49-
`.github/workflows/site.yml` regenerates publications, runs the test suite, builds the Jekyll site, and deploys it to GitHub Pages. On a direct push, it commits changes to `_papers/` and `pub.bib` when the BibTeX or sidecar sources produce new output. Pull requests must include current generated files.
49+
`.github/workflows/site.yml` runs automatically only when `bibliography/publications.bib` changes, then regenerates publications, runs the test suite, builds the Jekyll site, and deploys it to GitHub Pages. On a direct push, it commits changes to `_papers/` and `pub.bib`. The workflow remains available through manual dispatch for other site deployments.

tests/test_workflow.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def test_workflow_has_push_pull_request_and_manual_triggers(self) -> None:
2020
self.assertIn("pull_request", triggers)
2121
self.assertIn("workflow_dispatch", triggers)
2222

23+
def test_automatic_runs_are_limited_to_the_bibliography_file(self) -> None:
24+
triggers = self.workflow["on"]
25+
expected_paths = ["bibliography/publications.bib"]
26+
self.assertEqual(triggers["push"]["paths"], expected_paths)
27+
self.assertEqual(triggers["pull_request"]["paths"], expected_paths)
28+
2329
def test_workflow_regenerates_and_checks_publications(self) -> None:
2430
self.assertIn("python scripts/build_publications.py --strict", self.text)
2531
self.assertIn("python -m unittest discover -s tests -v", self.text)

0 commit comments

Comments
 (0)