Skip to main content

GitHub Actions

GitHub Actions provides continuous integration, which can automatically test, build, and publish your ChRIS plugin.

What is continuous integration?

Continuous integration is the practice of automating development and operations (devops) by testing, building, and redeploying your code whenever you push to GitHub.

General Background

DockerHub (docker.io) and the GitHub Container Registry (ghcr.io) are container registries, which is where built container images are saved.

ChRIS plugins are uploaded to a container registry, while their metadata are uploaded to a ChRIS backend. When you run a plugin on ChRIS, the backend pulls the plugin image from the container registry.

Developer's Workflow

The developer's workflow using CI looks like:

  1. Write code.
  2. git push
  3. git tag vX.Y.Z && git push --tags

After these human-made actions (push or created release), a chain of automatic steps execute to build, test, and publish your software. Additionally, pull requests can be automatically tested too (however pull requests do not get published until they are merged and tagged).

Repository Settings

Your GitHub repository settings should define the following secrets. For help, see https://docs.github.com/en/actions/reference/encrypted-secrets

tip

use organization level secrets. If your repository lives under https://github.com/FNNDSC, there is nothing you need to do.

Secret NameDescription
DOCKERHUB_USERNAMEDockerHub username
DOCKERHUB_PASSWORDDockerHub password
CHRISPROJECT_USERNAMEAdmin username for https://cube.chrisprojet.org/chris-admin/
CHRISPROJECT_PASSWORDAdmin password for https://cube.chrisprojet.org/chris-admin/

Use CI

python-chrisapp-template provides the file .github/workflows/ci.yml which defines the instructions for Github Actions. It is important to read and understand this file before using CI.