-
Notifications
You must be signed in to change notification settings - Fork 7
05 CI & CD with GitHub Actions & GitHub Pages
CI = Continuous Integration. This is the practice of automating the integration of (code) changes from multiple contributors into a single (software) project.
CD = Continuous Deployment. This is the practice of automatically launching the project to end-users via, for example, a website.
GitHub Actions allows for automation of software workflows. In our case, we use GitHub Actions to automate building and deploying the Handbook.
This means the Handbook can 'live' on GitHub instead of someone's local computer folder. Contributors don't have to manually build the book on their computers with R Studio, the book is (re)built automatically on GitHub when changes are made/approved.
GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, and publishes a website. The website is hosted on GitHub's github.io
domain and the URL reflects the user/organization and repository. The Handbook's URL is, therefore: https://utrechtuniversity.github.io/dataprivacyhandbook
Note: Technically, GitHub Actions takes care of the Continuous Deployment via GitHub Pages as well - but it's easier to document the process by splitting CI & CD into sections.
The following guide provided the basis for setting up our CI/CD workflow: https://medium.com/@delucmat/how-to-publish-bookdown-projects-with-github-actions-on-github-pages-6e6aecc7331e
The workflow is contained within the deploy_bookdown.yml
file which can found in dataprivacyhandbook -> .github -> workflows (link)
-
Steps from III Create a GitHub Action workflow were followed because the Handbook was already on GitHub.
-
The GH_PAT & EMAIL GitHub secrets were set up by Neha Moopen, and therefore linked to her GitHub account.
-
The default branch on the Handbook repository is
main
notmaster
. This was adjusted in thedeploy_bookdown.yml
workflow. -
The output directory was changed to
docs
instead of_book
in the initialbookdown
setup. This was also adjusted in thedeploy_bookdown.yml
workflow where the artifact'sname
,path
, andBUILD_DIR
have to be specified. -
The guide utilizes a GitHub Action workflow called GitHub Pages Deploy, but the version/release is outdated.
The guide shows:
uses: Cecilapp/GitHub-Pages-deploy@master
Whereas we have updated to:
uses: Cecilapp/GitHub-Pages-deploy@v2