-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (39 loc) · 1.27 KB
/
update_cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Update Master Cache
on:
schedule:
- cron: '0 2 * * 0' # As cache is emptied if not accessed for 7 days, check after 7 days whether container has changed
workflow_dispatch:
push:
branches:
- master
paths:
- 'resources/retinal-rl.def'
workflow_call:
env:
singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image
sif_file: retinal-rl_singularity-image.sif
jobs:
conditional-build:
uses: ./.github/workflows/container_build.yml
with:
deploy: ${{ github.event_name == 'push' }}
update-cache:
needs: conditional-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@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
- name: Pull Singularity container
if: steps.cache-singularity.outputs.cache-hit != 'true'
run: apptainer pull ${{ env.sif_file }} ${{ env.singularity_image }}