From 9d2dd13a14ae52d470112b50c1c67eef69dbf216 Mon Sep 17 00:00:00 2001 From: Altan Orhon Date: Tue, 17 Oct 2023 17:30:11 -0700 Subject: [PATCH] Updated workflow --- .github/workflows/apptainer-image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apptainer-image.yml b/.github/workflows/apptainer-image.yml index 51853d4..d87a6c9 100644 --- a/.github/workflows/apptainer-image.yml +++ b/.github/workflows/apptainer-image.yml @@ -2,7 +2,7 @@ name: Singularity Build on: push: tags: - - sif-* + - sif-*-v*.* jobs: build-and-push-image: @@ -18,8 +18,8 @@ jobs: uses: actions/checkout@v4 - name: Build Container run: | - cont_name="${GITHUB_REF_NAME#sif-}" - echo "Container name is ${cont_name:-}." + cont_name=$(echo "${GITHUB_REF_NAME:-}" | sed -E 's/^sif//; s/-v[0-9]+[.].*$//') + echo "Container name is $cont_name." [ -d "${cont_name:-}" ] || exit 1 pushd "${cont_name}" && apptainer build --fakeroot --fix-perms --warn-unused-build-args --build-arg ORAS_REPO="${{ github.repository }}" ../${cont_name}.sif Singularity && popd tag="${tag:-latest}"