This is a proof of concept to show how a Drupal 8 site could be built and hosted using Tome, GitHub Actions and GitHub Pages.
This is not a perfect setup for doing this by any means. However, I wanted to show how to do this using GitHub Actions and GitHub pages as they are inexpensive and can get the job done with a little but of work. You could easily apply these same strategies to a sandbox site on Pantheon and host your Drupal site for free.
Helpful Links:
- A cheap VPS is hosting the Drupal site.
- The Drupal site calls out to GitHub and kicks off a deployment.
- The deploy workflow in the
.github/workflows/
directory listens for deployments and starts the build process. - The workflow checks out the repo and builds the site
- THe workflow pulls the site files and database and sets up a clone of the live site
- The workflow runs the Tome generator
- The workflow publishes the generated static site to the
gh-pages
branch - Finally, the workflow marks the deployment a sucess (or failure if things went wrong).
- This currently does not do a good job of tracking the deploy once kicked off on the Drupal site (it doesn't do anything at all, actually).
- The (Build Hooks)[https://drupal.org/project/build_hooks] module reports changes after the deployment. I'm assuming I'm doing something wrong, but hey -- I built this in a day. I'm also not convinced that the Build Hooks module is here to stay. The project has not had a release in quite a while, so this may be reworked to stand on its own eventually.
- Hopefully GitHub Actions and other GitHub apis are extended in the future. Right now the feel somewhat limiting.