diff --git a/.github/workflows/singularity.yml b/.github/workflows/singularity.yml index 9fe895f..0b07a23 100644 --- a/.github/workflows/singularity.yml +++ b/.github/workflows/singularity.yml @@ -7,6 +7,9 @@ on: jobs: build-test-containers: runs-on: ubuntu-latest + permissions: + contents: read + packages: write strategy: fail-fast: false matrix: @@ -42,8 +45,9 @@ jobs: echo "tag=$tag" >> $GITHUB_ENV - name: Login and Deploy Container - if: (github.event_name != 'pull_request') + if: github.event_name != 'pull_request' run: | - echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io - container_name=$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]') - singularity push container.sif oras://ghcr.io/${container_name}:${tag} + echo "${{ secrets.GITHUB_TOKEN }}" | singularity registry login \ + -u "${{ github.repository_owner }}" --password-stdin oras://ghcr.io + container_name=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') + singularity push container.sif "oras://ghcr.io/${container_name}:${tag}"