Repository navigation
162 lines (139 loc) · 4.62 KB
/
Copy pathdeploy.yaml
File metadata and controls
162 lines (139 loc) · 4.62 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
name: Deploy
on:
workflow_call:
inputs:
container_image:
required: true
type: string
ref:
required: true
type: string
ref_name:
required: true
type: string
is_version_tag:
required: false
type: boolean
default: false
permissions:
contents: read
packages: write
jobs:
container:
name: Container Images
runs-on: ubuntu-latest
steps:
- 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: Create and push multi-arch manifest
run: |
docker buildx imagetools create \
-t "${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}" \
"${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-x86_64" \
"${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-arm64"
container-dev:
name: Container Dev Images
runs-on: ubuntu-latest
steps:
- 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: Publish dev image for current ref
run: |
docker buildx imagetools create \
-t "${{ inputs.container_image }}/dev:${{ steps.ref.outputs.tag }}" \
"${{ inputs.container_image }}/dev-fedora:${{ steps.ref.outputs.tag }}"
container-dev-vscode:
name: Container Dev VSCode Images
runs-on: ubuntu-latest
steps:
- 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: Publish dev-vscode image for current ref
run: |
docker buildx imagetools create \
-t "${{ inputs.container_image }}/dev-vscode:${{ steps.ref.outputs.tag }}" \
"${{ inputs.container_image }}/dev-vscode:${{ inputs.ref }}"
latest-container:
name: Container Images as latest
if: ${{ inputs.is_version_tag }}
needs: [container]
runs-on: ubuntu-latest
steps:
- 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: Tag and Push Image as latest
run: |
docker buildx imagetools create \
-t "${{ inputs.container_image }}:latest" \
"${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-x86_64" \
"${{ inputs.container_image }}:${{ steps.ref.outputs.tag }}-arm64"
latest-container-dev:
name: Container Dev Images as latest
if: ${{ inputs.is_version_tag }}
needs: [container-dev]
runs-on: ubuntu-latest
steps:
- 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: Tag and push dev image as latest
run: |
docker buildx imagetools create \
-t "${{ inputs.container_image }}/dev:latest" \
"${{ inputs.container_image }}/dev:${{ steps.ref.outputs.tag }}"