Skip to content

Commit 24c8b39

Browse files
committed
improve tagging
1 parent a90c85d commit 24c8b39

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Build and publish Docker image
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
5+
branches:
6+
- main
7+
- 'release/*'
8+
# pull_request:
9+
# branches: [ "main" ]
810

911
jobs:
1012

@@ -34,5 +36,12 @@ jobs:
3436
with:
3537
context: .
3638
push: true
37-
tags: ${{ steps.meta.outputs.tags }}
39+
tags: |
40+
${{ if startsWith(github.ref, 'refs/tags/') }}
41+
unic/drupal-php:${{ github.ref.replace('refs/tags/', '') }}
42+
{{ else if startsWith(github.ref, 'refs/heads/main') }}
43+
unic/drupal-php:latest
44+
{{ else if startsWith(github.ref, 'refs/heads/release/') }}
45+
unic/drupal-php:${{ github.ref.replace('refs/heads/release/', '') }}-latest
46+
{{ endif }}
3847
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)