Skip to content

Updated README

Updated README #2

name: Singularity Build
on:
push:
# Edit the branches here if you want to change deploy behavior
branches:
- main
- master
tags:
- release-*
jobs:
build-and-push-image:
runs-on: ubuntu-latest
name: Build Apptainer image
permissions:
contents: read
packages: write
steps:
- name: Install Apptainer
run: deb=$(curl -w "%{filename_effective}" -LO https://github.com/apptainer/apptainer/releases/download/v1.2.4/apptainer_1.2.4_amd64.deb) && sudo apt install -y "./$deb"; rm -f "$deb"; unset deb
- name: Check out code for the container build
uses: actions/checkout@v4
- name: Build Container
run: |
apptainer build container.sif Singularity
tag=$(echo "${recipe/Singularity\./}")
[ "$tag" == "Singularity" ] && tag=latest
# Build the container and name by tag
echo "Tag is $tag."
echo "tag=$tag" >> $GITHUB_ENV
- name: Login and Deploy Container
run: |
apptainer remote login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io
apptainer push container.sif oras://ghcr.io/${{ github.repository }}:${tag}