Workflow file for this run
This file contains hidden or 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
| name: Build and Push Apptainer Container | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-minimal: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Apptainer | |
| run: | | |
| sudo apt-get update -qq | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt-get update -qq && sudo apt-get install -y apptainer | |
| - name: Build minimal SIF | |
| run: | | |
| sudo apptainer build \ | |
| --build-arg BUILD_ENVS=false \ | |
| buscoclade-minimal.sif apptainer/buscoclade.def | |
| - name: Push minimal image | |
| run: | | |
| REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
| TAG="${{ github.event.release.tag_name }}" | |
| # Fallback: if not a release, use short SHA commit | |
| if [ -z "${TAG}" ]; then | |
| TAG="dev-${{ github.sha }}" | |
| TAG="${TAG:0:10}" | |
| fi | |
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
| apptainer registry login --username "${{ github.actor }}" \ | |
| --password-stdin oras://ghcr.io | |
| apptainer push buscoclade-minimal.sif oras://ghcr.io/${REPO}:${TAG}-minimal | |
| apptainer push buscoclade-minimal.sif oras://ghcr.io/${REPO}:latest | |
| build-full: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Apptainer | |
| run: | | |
| sudo apt-get update -qq | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt-get update -qq && sudo apt-get install -y apptainer | |
| - name: Build full SIF | |
| run: | | |
| sudo apptainer build \ | |
| --build-arg BUILD_ENVS=true \ | |
| buscoclade-full.sif apptainer/buscoclade.def | |
| - name: Push full image | |
| run: | | |
| REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
| TAG="${{ github.event.release.tag_name }}" | |
| if [ -z "${TAG}" ]; then | |
| TAG="dev-${{ github.sha }}" | |
| TAG="${TAG:0:10}" | |
| fi | |
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
| apptainer registry login --username "${{ github.actor }}" \ | |
| --password-stdin oras://ghcr.io | |
| apptainer push buscoclade-full.sif oras://ghcr.io/${REPO}:${TAG}-full |