CI/CD
This website implements Continuous Integration/Continuous Deployment with GitHub Actions. The following flows are supported:
Deploy To Preview Environment
A separate repository (with it's own GitHub Pages space) is maintained as a pre-prod environment. On any PR creation, a full build is run against the source, including:
- Unit test run & reports generation
- Docusaurus build (including dynamic, global CSS file required for Storybook)
- Storybook build (with dynamic styles in place)
- Deploy to remote branch
At the end of the build, a status is posted back to the pull request notifying the user the preview environment is ready.
The developer can view the preview site at iaindavis.dev/preview/(pr-number)
.
When the PR is closed or merged, a separate job runs to delete the preview environment.
Deploy to Production
The same process is carried out as the deploy-to-preview action, except that some stages which are allowed to fail in the preview build (like unit tests) will abort the build if they fail in production. And of course, the end result is that the website is deployed in its primary location at https://iaindavis.dev
Repository Map
Not strictly a part of the website: a GitHub Actions job runs on
creation or update of any branch (or tag). That job runs the
command-line utility tree
to create a map of the repository contents
at the head of the created ref. This map allows my AI code assistant,
Nova, to infer file locations from filenames. This low-effort,
low-tech fix streamlines instructions to Nova, and avoids wasting
rate-limited API calls on fetching data that is publicly available.
Repository trees are maintained in an orphan branch of the repository
called metadata
GitHub actions spec for branch creation GitHub actions spec for branch clean-up