Skip to content

Build and deploy Apptainer image #10

Build and deploy Apptainer image

Build and deploy Apptainer image #10

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 repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history including all tags
- name: Get latest tag
id: tag
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- 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:${{ env.LATEST_TAG }}