diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index f4458c1..5c141da 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -11,26 +11,24 @@ on: - "v*.*.*" env: TEST_TAG: ghcr.io/precimed/container_template:test - # LATEST_TAG: ghcr.io/precimed/container_template:latest jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - # list of Docker images to use as base name for tags images: | ghcr.io/${{ github.repository_owner }}/container_template - # generate Docker tags based on the following events/attributes tags: | type=schedule type=ref,event=branch type=ref,event=pr + type=pep440,pattern={{version}} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} diff --git a/.github/workflows/container_build_push.yml b/.github/workflows/container_build_push.yml index c04db91..4880b9d 100644 --- a/.github/workflows/container_build_push.yml +++ b/.github/workflows/container_build_push.yml @@ -13,19 +13,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | - ghcr.io/${{ github.repository_owner }}/container_template - # generate Docker tags based on the following events/attributes + ghcr.io/${{ github.repository_owner }}/container_template tags: | type=schedule type=ref,event=branch type=ref,event=pr + type=pep440,pattern={{version}} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -76,6 +76,10 @@ jobs: steps: - name: Check out code for the container builds uses: actions/checkout@v4 + - name: Setup Apptainer + uses: eWaterCycle/setup-apptainer@v2 + with: + apptainer-version: 1.3.4 - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -96,8 +100,7 @@ jobs: EOF push_tags="$(printf $csv_tags | sed -e "s/container_template/container_template_sif/g")" echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io - docker pull kaczmarj/apptainer:latest - docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build container_template.sif docker://"$first_tag" + apptainer build container_template.sif docker://"$first_tag" oras push "$push_tags" container_template.sif rm container_template.sif shell: sh