Skip to content

Commit 1f6cae7

Browse files
committed
improve tagging again
1 parent 24c8b39 commit 1f6cae7

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
push:
55
branches:
66
- main
7-
- 'release/*'
7+
- 'release/**'
88
# pull_request:
99
# branches: [ "main" ]
1010

1111
jobs:
1212

1313
push_to_registry:
14-
name: Push Docker image to Docker Hub
14+
name: Push Docker image to Docker Hub by @${{ github.actor }}
1515

1616
runs-on: ubuntu-latest
1717

@@ -30,18 +30,18 @@ jobs:
3030
uses: docker/metadata-action@v4
3131
with:
3232
images: unicdocker/drupal-php
33+
tags: |
34+
type=schedule
35+
type=ref,event=branch
36+
type=ref,event=tag
37+
type=ref,event=pr
38+
type=match,pattern=release\/([0-9]\.[0-9]+)$,group=0,suffix=-latest
39+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
3340
3441
- name: Build and push Docker image
3542
uses: docker/build-push-action@v4
3643
with:
3744
context: .
3845
push: true
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 }}
46+
tags: ${{ steps.meta.outputs.tags }}
4747
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)