Apptainer Build & Deploy #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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-ignore: | |
- "README.md" | |
- "LICENSE" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install Apptainer | |
run: | | |
apptainer_version=1.2.0 | |
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 treep | |
- name: Build trifinger_base.sif | |
run: make trifinger_base.sif | |
- name: Build trifinger_user.sif | |
run: make trifinger_user.sif | |
- name: Build trifinger_robot.sif | |
run: make trifinger_robot.sif | |
- name: Build solo_bolt_user.sif | |
run: make solo_bolt_user.sif | |
- name: Build solo_bolt_robot.sif | |
run: make solo_bolt_robot.sif | |
- name: Login and Deploy Container | |
run: | | |
if [ "${GITHUB_REF_NAME}" = "master" ] | |
then | |
tag=latest | |
else | |
tag=${GITHUB_REF_NAME} | |
fi | |
echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io | |
apptainer push trifinger_base.sif oras://ghcr.io/${GITHUB_REPOSITORY}/trifinger_base:${tag} | |
apptainer push trifinger_user.sif oras://ghcr.io/${GITHUB_REPOSITORY}/trifinger_user:${tag} | |
apptainer push trifinger_robot.sif oras://ghcr.io/${GITHUB_REPOSITORY}/trifinger_robot:${tag} | |
apptainer push solo_bolt_user.sif oras://ghcr.io/${GITHUB_REPOSITORY}/solo_bolt_user:${tag} | |
apptainer push solo_bolt_robot.sif oras://ghcr.io/${GITHUB_REPOSITORY}/solo_bolt_robot:${tag} |