18
18
- name : Install dependencies
19
19
run : |
20
20
python -m pip install --upgrade pip
21
- if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt ; fi
21
+ if [ -f backend/requirements.lock ]; then pip install -r backend/requirements.lock ; fi
22
22
pip install pytest
23
23
- name : Test
24
24
working-directory : ./backend/src
@@ -147,19 +147,27 @@ jobs:
147
147
id : buildx
148
148
uses : docker/setup-buildx-action@v2
149
149
150
- - name : Docker metadata main
151
- id : meta
150
+ - name : Docker metadata (dev)
151
+ id : meta-dev
152
152
uses : docker/metadata-action@v4
153
153
with :
154
154
images : |
155
155
ghcr.io/${{ github.repository }}
156
156
tags : |
157
- {% if needs.version-info.outputs.version contains 'dev' %}
158
157
type=raw,value=${{ needs.version-info.outputs.version }}
159
- {% else %}
158
+ type=raw,value=dev
159
+ if : contains(needs.version-info.outputs.version, 'dev')
160
+
161
+ - name : Docker metadata (release)
162
+ id : meta-release
163
+ uses : docker/metadata-action@v4
164
+ with :
165
+ images : |
166
+ ghcr.io/${{ github.repository }}
167
+ tags : |
160
168
type=raw,value=${{ needs.version-info.outputs.version }}
161
169
type=raw,value=latest
162
- {% endif %}
170
+ if : contains(needs.version-info.outputs.version, 'dev') == false
163
171
164
172
- name : Login to ghcr.io
165
173
uses : docker/login-action@v2
@@ -174,14 +182,28 @@ jobs:
174
182
name : dist
175
183
path : backend/src/dist
176
184
177
- - name : Build and push
185
+ - name : Build and push (dev)
186
+ uses : docker/build-push-action@v4
187
+ with :
188
+ context : .
189
+ builder : ${{ steps.buildx.output.name }}
190
+ platforms : linux/amd64,linux/arm64
191
+ push : true
192
+ tags : ${{ steps.meta-dev.outputs.tags }}
193
+ labels : ${{ steps.meta-dev.outputs.labels }}
194
+ cache-from : type=gha, scope=${{ github.workflow }}
195
+ cache-to : type=gha, scope=${{ github.workflow }}
196
+ if : contains(needs.version-info.outputs.version, 'dev')
197
+
198
+ - name : Build and push (release)
178
199
uses : docker/build-push-action@v4
179
200
with :
180
201
context : .
181
202
builder : ${{ steps.buildx.output.name }}
182
203
platforms : linux/amd64,linux/arm64
183
204
push : true
184
- tags : ${{ steps.meta.outputs.tags }}
185
- labels : ${{ steps.meta.outputs.labels }}
205
+ tags : ${{ steps.meta-release .outputs.tags }}
206
+ labels : ${{ steps.meta-release .outputs.labels }}
186
207
cache-from : type=gha, scope=${{ github.workflow }}
187
208
cache-to : type=gha, scope=${{ github.workflow }}
209
+ if : contains(needs.version-info.outputs.version, 'dev') == false
0 commit comments