Skip to content

Build and deploy Apptainer image #7

Build and deploy Apptainer image

Build and deploy Apptainer image #7

name: Build and deploy Apptainer image
on:
workflow_run:
workflows: ["Build and deploy PyPI package"]
types: [completed]
workflow_dispatch: # This allows manual triggering
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
image: kaczmarj/apptainer:latest
options: --privileged
name: Build and deploy container
steps:
- name: Check out the latest tag of the repo
uses: actions/checkout@v4
with:
ref: $(git describe --tags --abbrev=0)
fetch-depth: 0
- name: Build SIF image
run: |
apptainer build bidscoin.sif apptainer.def
- name: Login and deploy container
run: |
echo ${{ secrets.GITHUB_TOKEN }} | apptainer registry login -u "${{ github.actor }}" --password-stdin oras://ghcr.io
apptainer push bidscoin.sif oras://ghcr.io/donders-institute/bidscoin:${GITHUB_REF_NAME}