Skip to content

Update build.yaml

Update build.yaml #11

Workflow file for this run

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 commit-based sif name
run: |
echo "sif_name=degauss-geocoder_${{ github.sha }}.sif" >> $GITHUB_ENV
echo "sif_version=${{ github.sha }}" >> $GITHUB_ENV
- name: make tag-based sif name for releases and pull requests
if: ${{ github.event_name }} == "release" || ${{ github.event_name }} == "pull_request"
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 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.sif_version }}