Skip to content

CI/CD

What is CI/CD?

CI/CD (which stands for Continuous Integration, Continuous Delivery/Deployment) is, in theory, exactly what it says on the tin.

Continuous Integration

Continuous Integration refers to frequently (and automatically) uploading and merging code to the main repository. This keeps code merges small (reducing the chances and sizes of merge conflicts), and therefore more manageable. However, that's only one part of code integration - the other is continuous and automated testing. CI/CD is only made possible by continuous and automated builds and tests which run every time code is pushed to the main repository.

Continuous Delivery

Continuous Delivery refers to the project always being delivered in a functional, ready-to-go state, and handles any final stages needed to package the project and get it into a deployment ready state. Since this project is built with Nix, all dependencies are fixed and known ahead of time, so there's nothing extra to do here.

Continuous Deployment

Continuous Deployment is exactly what it sounds like - automatically deploying a project to production after the continuous delivery process of the pipeline finishes its build. For this project, we aren't employing continuous deployment for anything but the docs website - see below for details on that.

Execution

The CI/CD pipeline for this project is run entirely using GitHub Actions. The typical workflow looks something like this:

  1. Check out the repo with actions/checkout
  2. Install Nix with cachix/install-nix-action
  3. Set up Nix output caching with cachix/cachix-action
  4. Build the environment and run all tests using devenv --profile cicd test1
  5. If that succeeds, the builds are passing!
  6. Upload to Cachix so we can just download the builds next time

If you're curious about any specific workflow, they're all well commented.


  1. This profile inherits from all the others, so it builds everything.