-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.26 KB
/
container.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
43
44
45
46
name: Containers
on:
push:
branches: [ "CI_workflows" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set environment variables
run: |
pip install toml
echo "HOME_DEF=$GITHUB_WORKSPACE/.github/workflows" >> $GITHUB_ENV
VER=$(python3 -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
echo "VER=$VER" >> $GITHUB_ENV
- name: Install Apptainer
run: |
sudo apt update && sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt update && sudo apt install -y apptainer
sudo apt clean && sudo apt autoclean
- name: Build AMD64 image
run: |
apptainer build eophis_v${VER}_amd64.sif $HOME_DEF/apptainer_eophis.def
- name: Upload AMD64 Image as GitHub Artifact
uses: actions/upload-artifact@v4
with:
name: eophis_v${{ env.VER }}_amd64
path: ./eophis_v${{ env.VER }}_amd64.sif