Skip to content

build bdsim apptainers #15

build bdsim apptainers

build bdsim apptainers #15

name: build bdsim apptainers
on:
workflow_dispatch:
release:
types:
- published
jobs:
apptainer-bdsim:
name: build apptainer images from docker images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dockerimage: [alma9-g4.10.7-bdsim, alma9-g4.11.0-bdsim,
alma9-g4.11.1-bdsim, alma9-g4.11.2-bdsim,
alma9-g4.11.3-bdsim]
permissions:
contents: read
packages: write # required for GHCR access
steps:
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Check out the repo
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Flatten bdsim containers
shell: bash
run: |
docker pull bdsim/alma9-apptainer
docker run -v /tmp:/tmp --rm bdsim/alma9-apptainer apptainer build ${{ matrix.dockerimage }}_develop.sif docker:bdsim/${{ matrix.dockerimage }}:develop
du -sh /tmp/*sif
- name: Push to GHCR
env:
GHCR_USER: ${{ github.actor }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo $GHCR_USER
echo ${{ github.repository_owner }}
echo ${{ github.ref_name }}
docker run -v /tmp:/tmp --rm bdsim/alma9-apptainer echo "$GHCR_TOKEN" | apptainer remote login -u "$GHCR_USER" --password-stdin oras://ghcr.io && apptainer push /tmp/${{ matrix.dockerimage }}.sif oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.dockerimage }}:${{ github.ref_name }}