Skip to content

Commit 261dbdb

Browse files
committed
Adjust docker tags for dev releases
1 parent dee0313 commit 261dbdb

3 files changed

Lines changed: 16 additions & 19 deletions

File tree

.github/workflows/.build-push-docker-image.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
cache_mode:
1919
type: string
2020
default: min
21+
raw_tag:
22+
type: string
23+
version_tag:
24+
type: string
2125

2226
jobs:
2327
build-and-push-image:
@@ -44,12 +48,8 @@ jobs:
4448
with:
4549
images: ${{ inputs.registry }}/${{ inputs.image_name }}
4650
tags: |
47-
type=schedule
48-
type=ref,event=branch
49-
type=ref,event=tag
50-
type=ref,event=pr
51-
# set latest tag for main branch
52-
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
51+
type=semver,pattern={{version}},enable=${{ github.version_tag != '' }}
52+
type=raw,value=${{ github.raw_tag }},enable=${{ github.raw_tag != '' }}
5353
5454
- name: "Build${{ inputs.push && ' and push' || '' }}"
5555
uses: docker/build-push-action@v7

.github/workflows/docker-images.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker images
22

33
on:
44
pull_request:
5-
push:
6-
branches: [main]
75
merge_group:
86

97
permissions:
@@ -16,13 +14,11 @@ jobs:
1614
with:
1715
image_name: ${{ github.repository }}
1816
dockerfile: ./packaging/docker/Dockerfile
19-
push: ${{ github.ref_name == 'main' }}
2017
cache_mode: max
2118

2219
worker:
2320
uses: ./.github/workflows/.build-push-docker-image.yml
2421
with:
2522
image_name: ${{ github.repository }}-worker
2623
dockerfile: ./packaging/docker/worker.Dockerfile
27-
push: ${{ github.ref_name == 'main' }}
2824
cache_mode: off # cache is really slow for this file
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and release
1+
name: Release
22

33
on:
44
push:
@@ -25,28 +25,29 @@ jobs:
2525
path: worker/packaging/build/worker-${{matrix.target}}.tar.xz
2626
archive: false
2727

28-
docker-backend:
28+
push-docker-backend:
2929
uses: ./.github/workflows/.build-push-docker-image.yml
3030
with:
3131
image_name: ${{ github.repository }}
32+
raw_tag: dev+${{ github.sha }}
3233
dockerfile: ./packaging/docker/Dockerfile
33-
push: ${{ github.ref_name == 'main' }}
34+
push: true
3435
cache_mode: max
3536

36-
docker-worker:
37+
push-docker-worker:
3738
uses: ./.github/workflows/.build-push-docker-image.yml
3839
with:
3940
image_name: ${{ github.repository }}-worker
41+
raw_tag: dev+${{ github.sha }}
4042
dockerfile: ./packaging/docker/worker.Dockerfile
41-
push: ${{ github.ref_name == 'main' }}
43+
push: true
4244
cache_mode: off # cache is really slow for this file
4345

44-
45-
release:
46+
upload-release:
4647
needs:
4748
- build-worker-bundles
48-
- docker-backend
49-
- docker-worker
49+
- push-docker-backend
50+
- push-docker-worker
5051
runs-on: ubuntu-latest
5152
steps:
5253
- uses: actions/download-artifact@v8

0 commit comments

Comments
 (0)