Skip to content

Commit

Permalink
Merge pull request #15 from berenslab/feat-sif-cache-on-master
Browse files Browse the repository at this point in the history
Feat: SIF Cache on Master
  • Loading branch information
fabioseel authored Oct 16, 2024
2 parents 9bf848e + 9c99b1a commit 09e13d7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- master
paths:
- 'resources/retinal-rl.def'
workflow_call:

jobs:
singularity-build:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/update_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Master Cache

on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'resources/retinal-rl.def'

env:
singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image-latest
sif_file: retinal-rl_singularity-image-latest.sif

jobs:
container-build:
uses: ./.github/workflows/container_build.yml
update-cache:
needs: container-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.0
- name: Cache Singularity Image
id: cache-singularity
uses: actions/cache@v3
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
${{ runner.os }}-singularity-
- name: Pull Singularity container
if: steps.cache-singularity.outputs.cache-hit != 'true'
run: |
singularity registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io
singularity pull ${{ env.sif_file }} ${{ env.singularity_image }}

0 comments on commit 09e13d7

Please sign in to comment.