Skip to content

Apptainer Build & Deploy #28

Apptainer Build & Deploy

Apptainer Build & Deploy #28

Workflow file for this run

# Build Apptainer images and push them to the GitHub Container Registry of the
# repository.
#
# Runs automatically on pushes to master if they modify a def file and can also
# be executed manually ("workflow_dispatch" event).
# Images from the master branch are pushed with the "latest" tag, others with
# the name of the branch.
#
name: Apptainer Build & Deploy
on:
push:
branches:
- master
paths:
- "*.def"
- "Makefile"
workflow_dispatch:
inputs:
publish:
description: "Publish images (disable to only test the build)"
type: boolean
default: false
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Install Apptainer
run: |
apptainer_version=1.1.5
wget https://github.com/apptainer/apptainer/releases/download/v${apptainer_version}/apptainer_${apptainer_version}_amd64.deb
sudo apt-get install ./apptainer_${apptainer_version}_amd64.deb
- name: Check out code for the container build
uses: actions/checkout@v3
- name: Install treep
run: |
python3 -m pip install --no-cache-dir treep
- name: Build pam_base.sif
run: |
make pam_base.sif
df -h
apptainer cache list
- name: Build pam_mujoco.sif
run: |
make pam_mujoco.sif
df -h
apptainer cache list
- name: Login and Deploy Container
if: ${{ github.event_name == "push" || github.event.inputs.publish == 'true' }}

Check failure on line 55 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Apptainer Build & Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 55, Col: 19): Unexpected symbol: '"push"'. Located at position 22 within expression: github.event_name == "push" || github.event.inputs.publish == 'true'
run: |
if [ "${GITHUB_REF_NAME}" = "master" ]
then
tag=latest
else
tag=${GITHUB_REF_NAME}
fi
echo "Publish images using tag '${tag}'"
echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
apptainer push pam_base.sif oras://ghcr.io/${GITHUB_REPOSITORY}/pam_base:${tag}
apptainer push pam_mujoco.sif oras://ghcr.io/${GITHUB_REPOSITORY}/pam_mujoco:${tag}