File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 3
3
push :
4
4
tags :
5
5
- v*
6
+ branches :
7
+ - main
6
8
workflow_dispatch :
7
9
inputs :
8
10
dispatch_description :
21
23
runs-on : ubuntu-latest
22
24
steps :
23
25
- uses : actions/checkout@v2
24
- - name : Set image tag to version of the git tag
25
- if : ${{ startsWith(github.ref, 'refs/tags/server-v') }}
26
- run : |
27
- PREFIX="refs/tags/server-"
28
- VERSION="${GITHUB_REF:${#PREFIX}}"
29
- echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
30
- - name : Set image tag to the git commit hash
31
- if : ${{ !startsWith(github.ref, 'refs/tags/server-v') }}
32
- run : |
33
- echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
34
26
- name : Log in to the Container registry
35
27
uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
36
28
with :
@@ -42,11 +34,17 @@ jobs:
42
34
uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
43
35
with :
44
36
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37
+ tags : |
38
+ type=sha,event=branch
39
+ type=ref,event=tag
45
40
- name : Extract metadata (tags, labels) for Docker
46
41
id : meta_monitor
47
42
uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
48
43
with :
49
44
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-monitor
45
+ tags : |
46
+ type=sha,event=branch
47
+ type=ref,event=tag
50
48
- name : Build and push server docker image
51
49
uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
52
50
with :
You can’t perform that action at this time.
0 commit comments