Skip to content

Commit a1a4de3

Browse files
committed
Build docker images on release/x.x.x branches
1 parent aa99c9d commit a1a4de3

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/publish-slic-docker-image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- '[0-9]+.[0-9]+.[0-9]+'
8+
- 'release/[0-9]+.[0-9]+.[0-9]+'
89
release:
910
types: [published]
1011

@@ -52,7 +53,8 @@ jobs:
5253
images: ghcr.io/${{ github.repository }}-php${{ matrix.php_version }}
5354
tags: |
5455
type=edge,branch=main
55-
type=ref,event=branch
56+
type=ref,event=branch,enable=${{ !startsWith(github.ref, 'refs/heads/release/') }}
57+
type=match,pattern=release/(.*),group=1,enable=${{ startsWith(github.ref, 'refs/heads/release/') }}
5658
type=ref,event=tag
5759
type=semver,pattern={{raw}}
5860
flavor: |
@@ -104,6 +106,9 @@ jobs:
104106
TAG="${GITHUB_REF#refs/tags/}"
105107
else
106108
TAG="${GITHUB_REF#refs/heads/}"
109+
if [[ "$TAG" == release/* ]]; then
110+
TAG="${TAG#release/}"
111+
fi
107112
fi
108113
109114
IMAGE_BASE="ghcr.io/${{ github.repository }}-php${{ matrix.php_version }}"

.github/workflows/publish-wordpress-docker-image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- '[0-9]+.[0-9]+.[0-9]+'
8+
- 'release/[0-9]+.[0-9]+.[0-9]+'
89
release:
910
types: [published]
1011

@@ -128,7 +129,8 @@ jobs:
128129
images: ghcr.io/${{ github.repository }}-wordpress-php${{ matrix.php_version }}
129130
tags: |
130131
type=edge,branch=main
131-
type=ref,event=branch
132+
type=ref,event=branch,enable=${{ !startsWith(github.ref, 'refs/heads/release/') }}
133+
type=match,pattern=release/(.*),group=1,enable=${{ startsWith(github.ref, 'refs/heads/release/') }}
132134
type=ref,event=tag
133135
type=semver,pattern={{raw}}
134136
flavor: |
@@ -188,6 +190,9 @@ jobs:
188190
TAG="${GITHUB_REF#refs/tags/}"
189191
else
190192
TAG="${GITHUB_REF#refs/heads/}"
193+
if [[ "$TAG" == release/* ]]; then
194+
TAG="${TAG#release/}"
195+
fi
191196
fi
192197
193198
IMAGE_BASE="ghcr.io/${{ github.repository }}-wordpress-php${{ matrix.php_version }}"

0 commit comments

Comments
 (0)