push container to ghcr #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
build_apptainer: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: make versioned sif name | ||
run: | | ||
echo "sif_name=degauss-geocoder_${{ github.sha }}.sif" >> $GITHUB_ENV | ||
echo "version_tag="${{ github.sha }}" >> $GITHUB_ENV | ||
- uses: eWaterCycle/setup-apptainer@v2 | ||
with: | ||
apptainer-version: 1.3.3 | ||
- name: build the apptainer | ||
run: apptainer build --force ${{ env.sif_name }} degauss-geocode.def | ||
- name: saving sif file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.sif_name }} | ||
path: ${{ env.sif_name }} | ||
overwrite: true | ||
- name: push to ghcr | ||
run: | | ||
apptainer registry login --username cole-brokamp --password ${{ secrets.GITHUB_TOKEN }} docker://ghcr.io | ||
apptainer push ${{ env.sif_name }} oras://ghcr.io/${{ github.repository }}:${{ env.version_tag }} |