-
Notifications
You must be signed in to change notification settings - Fork 4
33 lines (31 loc) · 1.04 KB
/
build_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
name: Build container image
on:
workflow_dispatch:
push:
jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y wget
- name: Install Apptainer
run: |
wget https://github.com/apptainer/apptainer/releases/download/v1.2.4/apptainer_1.2.4_amd64.deb
sudo apt install -y ./apptainer_1.2.4_amd64.deb
rm ./apptainer_1.2.4_amd64.deb
- uses: actions/checkout@v4
- name: Build container
run: sudo apptainer build ML102.sif ML102.def
- name: Login and deploy
run: |
echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io
apptainer push ML102.sif "oras://ghcr.io/${GITHUB_REPOSITORY}:latest"
if: ${{ github.ref == 'refs/heads/main' }}