Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading