let it write #15
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 | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: make commit-based sif name | |
run: | | |
echo "sif_name=degauss-geocoder_${{ github.sha }}.sif" >> $GITHUB_ENV | |
echo "sif_version=${{ github.sha }}" >> $GITHUB_ENV | |
- name: if a release, make a tag-based sif name | |
if: github.event_name == 'release' | |
run: | | |
echo "sif_name=degauss-geocoder_${{ github.ref_name }}.sif" >> $GITHUB_ENV | |
echo "sif_version=${{ github.ref_name }}" >> $GITHUB_ENV | |
- uses: eWaterCycle/setup-apptainer@v2 | |
with: | |
apptainer-version: 1.3.3 | |
- name: build apptainer | |
run: apptainer build --force ${{ env.sif_name }} degauss-geocode.def | |
- 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.sif_version }} |