Integrate with GitHub Actions
Declared a .github/workflows/git-read.yml
file to configure steps necessary to
leverage GitHub actions.
The desired outcome is to publish a git-read
-generated website to that
project’s gh-pages
branch.
To achieve this, execute the following steps upon a git push
origin/main
:
clone the host project’s entire source code history with
fetch-depth: 0
toexecute
bin/git-read
to generate a website from the host project’s Git History
In support of deploying to a GitHub pages, we’ll also need to add
support for nesting the output under a subdirectory. Since the output
HTML has a potential to be served under a path (for example,
https://seanpdoyle.github.io/git-read), read from the PATH_PREFIX
environment variable, then prefix all sitemap URLs with that prefix.
Installation Script
Introduce the script/install
file to execute the
necessary commands to configure the project to be executable. Mainly,
install its RubyGems dependencies and its Yarn
dependencies.
Test Suite
While the .github/workflows/git-read.yml
file serves as an example of how to
integrate git-read
into a project’s GitHub Actions, the
.github/workflows/ci.yml
declares its own
GitHub Action to run the project’s test suite, ensuring that the tool
behaves as expected, and that future revisions won’t introduce
regressions.