File tree 1 file changed +17
-7
lines changed
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 9
9
10
10
- name : Checkout
11
11
uses : actions/checkout@v2
12
-
13
- - name : Set env
14
- run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
12
+
15
13
16
14
- name : Login to Public ECR
17
15
uses : docker/login-action@v1
@@ -42,13 +40,25 @@ jobs:
42
40
- name : Maven package
43
41
run : mvn package -B
44
42
43
+
44
+ -
45
+ name : Docker meta
46
+ id : meta
47
+ uses : docker/metadata-action@v3
48
+ with :
49
+ images : public.ecr.aws/m4k8r3n4/k8s-demo-app
50
+ tags : |
51
+ type=ref,event=branch
52
+ type=ref,event=pr
53
+ type=semver,pattern={{version}}
54
+ type=semver,pattern={{major}}.{{minor}}
55
+
45
56
- name : Build and push Docker images
46
57
47
58
with :
48
59
context : .
49
60
platforms : linux/amd64
50
- push : true
51
- tags : |
52
- public.ecr.aws/m4k8r3n4/k8s-demo-app:latest
53
- public.ecr.aws/m4k8r3n4/k8s-demo-app:$RELEASE_VERSION
61
+ push : ${{ github.event_name != 'pull_request' }}
62
+ tags : ${{ steps.meta.outputs.tags }}
63
+ labels : ${{ steps.meta.outputs.labels }}
54
64
You can’t perform that action at this time.
0 commit comments