Skip to content

docker://

docker:// #10

name: apptainer
on:
push:
branches:
- 'main'
tags:
- "v*.*.*"
jobs:
build-apptainer-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
name: Build Apptainer Container
steps:
- name: Check out code for the container builds
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/nothingtoseehere
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Apptainer container
run: |
tags="${{ steps.meta.outputs.tags }}"
echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io
docker pull kaczmarj/apptainer:latest
echo "$tags"
for tag in $tags; do
echo "processing tag: $tag"
docker pull docker://"$tag"
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build nothingtoseehere.sif docker-daemon://"$tag"
# oras push "$tag" --artifact-type application/vnd.acme.rocket.config nothingtoseehere.sif
rm nothingtoseehere.sif
done
shell: sh