Skip to content

Commit

Permalink
Use action to login to GHCR and use it for tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
pzehner committed Nov 4, 2024
1 parent 507ec46 commit 7141331
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/__build_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ jobs:
sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb
- name: Login in GitHub Containers Repository with Docker
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login in GitHub Containers Repository with Singularity
run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ jobs:
"echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io"
if: ${{ matrix.backend.use_singularity }}

- name: Login in GitHub Containers Repository with Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ ! matrix.backend.use_singularity }}

- name: Pull Singularity image
# pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io
run: |
Expand Down

0 comments on commit 7141331

Please sign in to comment.