diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 7dcf6c64..aaa134c1 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -1,9 +1,12 @@ # Rebuilds the published site on the gh-pages branch: downloads any Checker Framework or # Annotation File Utilities release that is not on the site yet, regenerates the pages from -# the templates in src/main/resources, and pushes the result. +# the templates in src/main/resources, copies the site's hand-written pages (index.md, +# 404.html) and _config.yml from master, and pushes the result. # # It runs daily on a schedule (checking if new releases exist before checking out gh-pages), # or can be run manually from the Actions tab. Manual runs default to a dry run. +# The scheduled check only looks for new releases, so after changing a page on master, +# run the workflow manually to publish it. name: Publish website @@ -106,9 +109,14 @@ jobs: fi done + - name: Copy the hand-written site pages and configuration from master + # These are edited on master, but only the generated afu/ and cf/ trees used to be + # published, so edits to them never reached the site. + run: cp generator/index.md generator/404.html generator/_config.yml site/ + - name: Stage changes working-directory: site - run: git add -A afu cf + run: git add -A afu cf index.md 404.html _config.yml - name: Summarize the changes working-directory: site diff --git a/README.md b/README.md index 3958e110..dc92afda 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,20 @@ box unchecked to publish. git checkout master mvn package git checkout gh-pages +git checkout master -- index.md 404.html _config.yml java -cp ./target/eisop.github.io-1.0-SNAPSHOT-jar-with-dependencies.jar \ io.github.eisop.website.EisopSiteGenerator git status && git diff # review -git add afu/ cf/ && git commit +git add afu/ cf/ index.md 404.html _config.yml && git commit git push origin gh-pages ``` The page templates live in `src/main/resources/` and are packaged into the jar, so the generator always uses the templates belonging to the code you built. -Nothing on `gh-pages` needs to be kept in sync with `master`. +The hand-written pages `index.md` and `404.html` and the Jekyll configuration +`_config.yml` are edited on `master` and copied to `gh-pages` when publishing. +The scheduled run publishes only when there is a new release, so after editing +one of them, run the workflow manually. ### Pre-release validation