Skip to content

Build container images #3

Build container images

Build container images #3

Workflow file for this run

name: Build container images
on:
workflow_dispatch:
inputs:
image-name:
required: true
type: choice
description: 'Dependant images will also be rebuilt'
options:
- rocky8
- rocky8vis
- rocky8vdt
workflow_call:
inputs:
image-name:
required: true
type: string
env:
APPTAINER_SRC: "https://github.com/apptainer/apptainer/releases/download/v1.1.0-rc.2/apptainer_1.1.0-rc.2_amd64.deb"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y wget
- name: Install Apptainer
run: |
wget $APPTAINER_SRC
sudo apt-get install -y ./${APPTAINER_SRC##*/}
- uses: actions/checkout@v3
- name: Build Container
working-directory: ./sif
run: |
sudo apptainer build ${{ inputs.image-name }}.sif ${{ inputs.image-name }}.def
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
singularity push ${{ inputs.image-name }}.sif "oras://ghcr.io/${GITHUB_REPOSITORY}/${{ inputs.image-name }}:latest"