As explained on GitHub:
GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.
I’ve heard about this feature and I decided to give it a first go yesterday as I
wanted to deploy a notebook for the McCann Lab’s Theory
Club built with
bookdown. As it uses the form of an R package, I figured
the easiest approach was to google “github actions R” and this is how I learned
about the R package ghactions. This
package generates the file you need to set up your GitHub Actions workflow, i.e.
a YAML file in
that the notebook I was deploying was a static website I opted for
as a workflow:
With this first file in hand, I then examined the the documentation as well as three GitHub repositories where I found valuable examples:
and tweaked the file based on these! Below is the final version of my workflow (see the file on GitHub):
which worked well:
After ~3min, the job was completed and the website deployed 🎉.
Something that is worth noticing is that it is designed to work with Docker which makes GitHub Actions quite powerful because setting up an environment becomes almost trivial! In my case, I basically needed Linux + R + publishing stuff, and this only required the following two lines (thanks to the great work of the Rocker team 👏):
The remaining steps are self explanatory. Note that to better understand how to deploy the website, I followed the guidelines available on the README of the repository actions-gh-pages maintained by peaceiris, that are very well laid-out1. The last step was to add the badge, I used ghactions2 once more:
to generate the following badge3:
The workflow and the website are available in the repository of the theory club and if you want to learn more about it, you should have a look at the documentation, there are also several blogposts introducing this feature (e.g. one by Paul Czarkowski, another by Austin Roy)!