-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (65 loc) · 2.54 KB
/
build-docker-corsika-simtelarray-image.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
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: docker-corsika-simtelarray
on:
workflow_dispatch:
pull_request:
paths:
- './docker/Dockerfile-simtelarray'
release:
types: [published]
schedule:
- cron: '0 0 * * 0' # Every Sunday at 00:00 UTC
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-corsika-simtelarray:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
production: ['prod6-sc', 'prod6-baseline', 'prod5', 'prod5-sc']
version: ['240927']
hadronic_model: ['qgs2']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: download corsikasimtelpackage
run: |
echo "CLOUD_SIMTEL_${{ matrix.version }}"
wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets[format('CLOUD_SIMTEL_{0}', matrix.version)] }}/download
mv download corsika7.7_simtelarray.tar.gz
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=ref,event=pr
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value={{date 'YYYYMMDD-HHmmss'}}
images: ${{ env.REGISTRY }}/gammasim/simtools-corsika-sim-telarray-${{ matrix.hadronic_model }}-${{ matrix.production }}-${{ matrix.version }}
flavor: latest=true
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v8
build-args: '{"BUILD_OPT": ${{ matrix.production }}, "HADRONIC_MODEL": "qgs2"}'
push:
${{ github.event_name == 'release' || github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }}
file: ./docker/Dockerfile-simtelarray
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}-corsika-sim-telarray-${{ matrix.hadronic_model }}-${{ matrix.production }}-${{ matrix.version }}