-
Notifications
You must be signed in to change notification settings - Fork 8
/
github-actions-ci.yaml
60 lines (51 loc) · 1.87 KB
/
github-actions-ci.yaml
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
51
52
53
54
55
56
57
58
59
60
# Copyright (c) 2022, Sylabs Inc. All rights reserved.
# This software is licensed under a 3-clause BSD license. Please consult the
# LICENSE.md file distributed with the sources of this project regarding your
# rights to use or distribute this software.
name: Build Def
on:
push:
branches:
- "main"
env:
DOCKER_BUILD_CLIENT: "sylabsio/scs-build"
DEF_FILE: "alpine.def" # REPLACE with Def file in a repo.
OUTPUT_SIF: "alpine.sif" # REPLACE with SIF name
LIBRARY_PATH: "library:<PROJECT>/<REPO>/<IMG>:<TAG>" # REPLACE with library path to store sif.
jobs:
# Build SIF and store SIF as an CI artifact.
build-artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Make Tmp Dir
run: |
mkdir -p ${{ github.workspace }}/tmp-sif-path
- name: Build image
env:
SYLABS_AUTH_TOKEN: ${{ secrets.SYLABS_AUTH_TOKEN }}
run: |
docker run -v ${{ github.workspace }}:/app \
-u $(id -u ${USER}):$(id -g ${USER}) \
$DOCKER_BUILD_CLIENT build \
--skip-verify /app/$DEF_FILE "/app/$OUTPUT_SIF"
- name: Move Sif
run: mv ${{ github.workspace }}/$OUTPUT_SIF ${{ github.workspace }}/tmp-sif-path/$OUTPUT_SIF
- name: Save image
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT_SIF }}
path: ${{ github.workspace }}/tmp-sif-path
# Build SIF and Push to cloud.sylabs.io
# push-cloud:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Build and Push SIF
# env:
# SYLABS_AUTH_TOKEN: ${{ secrets.SYLABS_AUTH_TOKEN }}
# run: |
# docker run -v ${{ github.workspace }}:/app \
# -u $(id -u ${USER}):$(id -g ${USER}) \
# $DOCKER_BUILD_CLIENT \
# scs-build build --skip-verify /app/$DEF_FILE $LIBRARY_PATH