Repository navigation
120 lines (106 loc) · 3.26 KB
/
Copy pathpackaging-container.yaml
File metadata and controls
120 lines (106 loc) · 3.26 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
name: Packaging (Containers)
on:
workflow_call:
inputs:
container_image:
required: true
type: string
ref:
required: true
type: string
ref_name:
required: true
type: string
env:
CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release
DOCKER_FILE: packaging/docker/Dockerfile.debian
permissions:
contents: read
packages: write
jobs:
container-x86_64:
name: "Container [x86_64]"
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
allow-unsafe-pr-checkout: true
fetch-depth: 0
submodules: recursive
- name: Build Image
uses: docker/setup-buildx-action@v4
- name: Login to Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Compute safe ref Tag
id: ref
env:
REF_NAME: ${{ inputs.ref_name }}
run: echo "tag=${REF_NAME//\//-}" >> "$GITHUB_OUTPUT"
- name: Build and Push Image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ env.DOCKER_FILE }}
target: app
push: true
pull: true
platforms: amd64
cache-from: |
type=gha,scope=dev-debian
type=gha,scope=app-x86_64
cache-to: ${{ github.event_name != 'pull_request_target' && 'type=gha,mode=max,scope=app-x86_64' || '' }}
build-args: |
ARCH=x86_64
TRIPLET=x86_64-linux-gnu
CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }}
tags: ${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-x86_64
container-arm64:
name: "Container [arm64]"
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
allow-unsafe-pr-checkout: true
fetch-depth: 0
submodules: recursive
- name: Build Image
uses: docker/setup-buildx-action@v4
- name: Login to Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Compute safe ref Tag
id: ref
env:
REF_NAME: ${{ inputs.ref_name }}
run: echo "tag=${REF_NAME//\//-}" >> "$GITHUB_OUTPUT"
- name: Build and Push Image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ env.DOCKER_FILE }}
target: app
push: true
pull: true
platforms: linux/arm64
cache-from: type=gha,scope=app-arm64
cache-to: ${{ github.event_name != 'pull_request_target' && 'type=gha,mode=max,scope=app-arm64' || '' }}
build-args: |
ARCH=arm64
TRIPLET=aarch64-linux-gnu
CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }}
tags: ${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-arm64