Skip to content

Commit

Permalink
Publish release tags for containers, on release (#100)
Browse files Browse the repository at this point in the history
* Publish release tags for containers, on release

* Fix workflow

---------

Co-authored-by: Jean-Philippe Lenain <[email protected]>
  • Loading branch information
jlenain and jlenain authored Feb 1, 2024
1 parent d062d8e commit a4efd8d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
apptainer-version: 1.1.7

- name: Build ${{ matrix.deffiles[1] }}
- name: Build ${{ env.container }} container
run: |
echo "Preparing to build ${{ env.container }} from ${{ matrix.deffiles[0] }}"
if [ ! -f "${{ matrix.deffiles[0]}}" ]; then
Expand All @@ -55,7 +55,14 @@ jobs:
run: |
echo ${{ github.token }} | apptainer remote login --username ${{ github.actor }} --password-stdin oras://${{ env.registry }}
- name: Deploy ${{ matrix.deffiles[1] }}
- name: Deploy ${{ env.container }} container ${{ github.ref }}
# Assign the release tag to container on release
if: github.event_name == 'release'
run: |
apptainer push ${{ env.container }}.sif oras://${{ env.registry }}/${{ github.repository }}:${{ github.ref }}
- name: Deploy ${{ env.container }} container ${{ matrix.deffiles[1] }}
# Otherwise, the container tag is "latest" by default.
# Don't push the container on a pull request.
if: github.event_name != 'pull_request'
run: |
Expand Down

0 comments on commit a4efd8d

Please sign in to comment.