This is based on @vsoch's amazingly useful singularity-deploy template.
Instead of building the SIF
directly, my version uses a Dockerfile with the Docker build-push action to upload a Docker image to the GitHub container registry.
Right now you can only have one Dockerfile per repo, until I work out how to use the build-push
action to build multiple containers.
The steps are pretty similar to @vsoch's orignal repo:
- Template or fork.
- Edit the repo:
- Check out a new branch
- Modify the
Docker
recipe (Dockerfile
) - Update the Version file
- Push the new branch to GitHub
- Open a PR for the new branch. This triggers the test build, which just builds the Docker image but doesn't push it.
- Once the check passes, merge the PR. This creates a release, re-builds the Docker image and uploads it to GHCR.
To get the repo to work with GHCR:
- Enable GHCR for your account.
- Use the following URL to create a Personal Access Token with the scopes
read:packages
,write:packages
anddelete:packages
. https://github.com/settings/tokens/new?scopes=write:packages.
This is documented here. - Add the PAT to the Repository Secrets and call it
CR_PAT
(Settings -> Secrets -> New Repository Secret)
These steps allow the actions runner to authenticate with GHCR and push/pull the images.