-
Notifications
You must be signed in to change notification settings - Fork 3
162 lines (155 loc) · 5.65 KB
/
feelpp-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
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
name: Feelpp Docker
run-name: "[${{ github.event.client_payload.flavor }}${{ inputs.flavor }}:${{ github.event.client_payload.dist }}${{ inputs.dist }}-${{ github.event.client_payload.version }}${{ inputs.version }}]"
on:
repository_dispatch:
types: [pkg-feelpp-published]
workflow_dispatch:
inputs:
flavor:
description: 'Flavor of the distribution'
required: true
default: ubuntu
dist:
description: 'Name of the distribution'
required: true
default: jammy
version:
description: 'Version of Feel++ packages'
required: true
jobs:
activate:
runs-on: self-docker
if: |
github.repository == 'feelpp/docker' &&
!startsWith(github.event.head_commit.message, 'Release ') &&
!contains(github.event.head_commit.message, 'ci skip')
steps:
- run: echo ok go
deliver:
if: ${{ github.event_name == 'repository_dispatch' && !contains(github.event.head_commit.message, 'deliver skip') }}
runs-on: self-docker
needs: activate
strategy:
fail-fast: false
matrix:
include:
- {
service: "${{ github.event.client_payload.component }}",
flavor: "${{ github.event.client_payload.flavor }}",
dist: "${{ github.event.client_payload.dist }}",
version: "${{ github.event.client_payload.version }}",
tag: "v${{ github.event.client_payload.version }}-${{ github.event.client_payload.dist }}",
dockerfile: "Dockerfile-${{ github.event.client_payload.dist }}",
dockerfile-dev: "Dockerfile"
}
name: Build and Push feelpp/${{ matrix.service }}:${{ matrix.tag }}
steps:
- uses: actions/[email protected]
with:
# lfs: true
token: ${{ secrets.CR_PAT }}
submodules: recursive
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build ${{ matrix.service }}:${{ matrix.tag }}
uses: docker/build-push-action@v3
if: ${{ matrix.service == 'feelpp' }}
with:
context: ./${{ matrix.service }}/
tags: ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.tag }},ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.dist }}
file: ${{ matrix.service }}/${{ matrix.dockerfile }}
build-args: |
IMAGE=${{ matrix.flavor }}:${{ matrix.dist }}
FLAVOR=${{ matrix.flavor }}
DIST=${{ matrix.dist }}
VERSION=${{ matrix.version }}
push: true
secrets: |
GIT_AUTH_TOKEN=${{ secrets.CR_PAT }}
-
name: Build ${{ matrix.service }}-dev:${{ matrix.tag }}
uses: docker/build-push-action@v3
with:
context: ./${{ matrix.service }}-dev/
tags: ghcr.io/feelpp/${{ matrix.service }}-dev:${{ matrix.tag }},ghcr.io/feelpp/${{ matrix.service }}-dev:${{ matrix.dist }}
file: ${{ matrix.service }}-dev/${{ matrix.dockerfile-dev }}
build-args: TAG=${{ matrix.tag }}
push: true
secrets: |
GIT_AUTH_TOKEN=${{ secrets.CR_PAT }}
manual:
if: ${{ github.event_name == 'workflow_dispatch' && !contains(github.event.head_commit.message, 'deliver skip') }}
runs-on: self-docker
needs: activate
strategy:
fail-fast: false
matrix:
include:
- {
service: "feelpp",
flavor: "${{ inputs.flavor }}",
dist: "${{ inputs.dist }}",
version: "${{ inputs.version }}",
tag: "v${{ inputs.version }}-${{ inputs.dist }}",
dockerfile: "Dockerfile",
dockerfile-dev: "Dockerfile"
}
name: Build and Push feelpp/${{ matrix.service }}:${{ matrix.tag }}
steps:
- uses: actions/[email protected]
with:
# lfs: true
token: ${{ secrets.CR_PAT }}
submodules: recursive
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build ${{ matrix.service }}:${{ matrix.tag }}
uses: docker/build-push-action@v3
if: ${{ matrix.service == 'feelpp' }}
with:
context: ./${{ matrix.service }}/
tags: ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.tag }},ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.dist }}
file: ${{ matrix.service }}/${{ matrix.dockerfile }}
build-args: |
IMAGE=${{ matrix.flavor }}:${{ matrix.dist }}
FLAVOR=${{ matrix.flavor }}
DIST=${{ matrix.dist }}
VERSION=${{ matrix.version }}
push: true
secrets: |
GIT_AUTH_TOKEN=${{ secrets.CR_PAT }}
-
name: Build ${{ matrix.service }}-dev:${{ matrix.tag }}
uses: docker/build-push-action@v3
with:
context: ./${{ matrix.service }}-dev/
tags: ghcr.io/feelpp/${{ matrix.service }}-dev:${{ matrix.tag }},ghcr.io/feelpp/${{ matrix.service }}-dev:${{ matrix.dist }}
file: ${{ matrix.service }}-dev/${{ matrix.dockerfile-dev }}
build-args: TAG=${{ matrix.tag }}
push: true
secrets: |
GIT_AUTH_TOKEN=${{ secrets.CR_PAT }}