-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.46 KB
/
singularity.yml
File metadata and controls
50 lines (43 loc) · 1.46 KB
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
43
44
45
46
47
48
49
50
name: Singularity Build
on:
push:
branches: ['main']
pull_request:
jobs:
build-test-containers:
runs-on: ubuntu-latest
strategy:
# Keep going on other deployments if anything bloops
fail-fast: false
matrix:
singularity_version:
- '3.8.1'
container:
image: quay.io/singularity/singularity:v${{ matrix.singularity_version }}
options: --privileged
steps:
- name: Check out code for the container builds
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build Container
run: |
if [ -f Singularity ]; then
sudo -E singularity build container.sif Singularity
else
echo "Singularity is not found."
echo "Present working directory: $PWD"
ls
fi
- name: Set Tag Based on Branch Name
run: |
# Get the branch name and set it as the tag
tag=${GITHUB_REF##*/}-singularity
echo "Tag is $tag."
echo "tag=$tag" >> $GITHUB_ENV
- name: Login and Deploy Container
if: (github.event_name != 'pull_request')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
container_name=$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]')
singularity push container.sif oras://ghcr.io/${container_name}:${tag}