-
-
Notifications
You must be signed in to change notification settings - Fork 39
49 lines (47 loc) · 1.92 KB
/
build_docker_slurm.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
47
48
49
name: "Build docker SLURM images"
on:
pull_request:
paths:
- 'tests/integration/docker-slurm/Dockerfile*'
- 'tests/integration/docker-slurm/*.conf'
- 'tests/integration/docker-slurm/entrypoint.sh'
push:
paths:
- 'tests/integration/docker-slurm/Dockerfile*'
- 'tests/integration/docker-slurm/*.conf'
- 'tests/integration/docker-slurm/entrypoint.sh'
branches:
- '**'
tags-ignore:
- '**'
workflow_dispatch:
jobs:
build_images:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: tests/integration/docker-slurm
strategy:
matrix:
os: ["amzn2", "amzn2023", "el7", "el8", "el9", "sl15", "ub20", "ub22", "ub24"]
steps:
- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Get Slurm version
id: get_slurm_version
run: |
slurm_version=$(cat current_version)
echo "slurm_version=${slurm_version}" >> $GITHUB_OUTPUT
- name: Build Docker image ghcr.io/neilmunday/slurm-mail/slurm-${{ matrix.os }}:${{ steps.get_slurm_version.outputs.slurm_version }}
run: |
docker build --build-arg SLURM_VER=${{ steps.get_slurm_version.outputs.slurm_version }} -f Dockerfile.${{ matrix.os }} -t ghcr.io/neilmunday/slurm-mail/slurm-${{ matrix.os }}:${{ steps.get_slurm_version.outputs.slurm_version }} -t ghcr.io/neilmunday/slurm-mail/slurm-${{ matrix.os }}:latest .
- name: Push Docker image ghcr.io/neilmunday/slurm-mail/slurm-${{ matrix.os }}:${{ steps.get_slurm_version.outputs.slurm_version }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
docker push -a ghcr.io/neilmunday/slurm-mail/slurm-${{ matrix.os }}