Skip to content

Updated workflow

Updated workflow #3

Workflow file for this run

name: Singularity Build
on:
push:
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}