-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds apptainer definition and config to automatically build the apptainer image on release. Part of #27
- Loading branch information
1 parent
12c503d
commit 27e36c3
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Create and publish an Apptainer image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Apptainer | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
- name: Setup apptainer executable | ||
uses: eWaterCycle/setup-apptainer@v2 | ||
with: | ||
apptainer-version: 1.3.0 | ||
|
||
- name: Build an apptainer image | ||
run: apptainer build --build-arg PYBIOCLIP_VERSION=${{ steps.meta.outputs.version }} bioclip.sif apptainer.def | ||
|
||
- name: Publish apptainer image | ||
run: apptainer push bioclip.sif oras://ghcr.io/johnbradley/apptainer-test:${{ steps.meta.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Bootstrap: docker | ||
From: condaforge/miniforge3:24.3.0-0 | ||
|
||
%arguments | ||
PYBIOCLIP_VERSION= | ||
|
||
%post | ||
pip install "https://github.com/Imageomics/pybioclip/archive/refs/tags/{{ PYBIOCLIP_VERSION }}.tar.gz" && pip cache purge | ||
|
||
%runscript | ||
exec bash |