-
Notifications
You must be signed in to change notification settings - Fork 95
84 lines (74 loc) · 2.5 KB
/
docker.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Docker
on:
push:
branches:
- master
- next
# Add your branch here if you want containers for it
- db-WIP
- docker-ci
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: Build ${{ matrix.config.name }} Container (${{ matrix.metric3d.name }} ; ${{matrix.mpi}})
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
mpi: [mpich]
metric3d:
- name: "With OpenMP"
cmake: ON
base_prefix: "openmp-"
tag_prefix: "3d-"
- name: "Without OpenMP"
cmake: OFF
base_prefix: ""
tag_prefix: ""
config:
- name: "Debug"
tag_postfix: "debug"
options: "-DCHECK=3"
base_postfix: "mini"
- name: "Optimised"
tag_postfix: "opt"
options: "-DCHECK=0"
base_postfix: "mini"
- name: "Full"
tag_postfix: "full"
options: "-DCHECK=3"
base_postfix: "full"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@879dcbb708d40f8b8679d4f7941b938a086e23a7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
prefix=${{ matrix.mpi }}-${{matrix.metric3d.tag_prefix}}${{ matrix.config.tag_postfix }}-
- name: Build and push Docker image
uses: docker/build-push-action@0f847266c302569530c95bfa228489494c43b002
with:
build-args: |
BASE=${{ matrix.mpi }}-${{ matrix.metric3d.base_prefix }}${{ matrix.config.base_postfix }}-main
MPI=${{ matrix.mpi }}
CMAKE_OPTIONS=${{ matrix.config.options }} -DBOUT_ENABLE_METRIC_3D=${{ matrix.metric3d.cmake }} -DBOUT_ENABLE_OPENMP=${{ matrix.metric3d.cmake }}
COMMIT=${{ github.sha }}
URL=${{ github.server_url }}/${{ github.repository }}
context: .docker/fedora/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}