File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1
1
name : Build Docker image
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ branches :
6
+ - " main"
7
+ tags :
8
+ - " v*"
9
+
10
+ pull_request :
11
+ branches :
12
+ - " main"
4
13
5
14
jobs :
6
15
docker :
12
21
- name : Set up Docker Buildx
13
22
uses : docker/setup-buildx-action@v1
14
23
24
+ - name : Docker meta
25
+ id : meta
26
+ uses : docker/metadata-action@v3
27
+ with :
28
+ images : ${{ secrets.DOCKERHUB_USERNAME }}/pyth-client-py
29
+
15
30
- name : Login to DockerHub
16
31
uses : docker/login-action@v1
17
32
with :
23
38
uses : docker/build-push-action@v2
24
39
with :
25
40
platforms : linux/amd64
26
- push : true
27
- tags : ${{ secrets.DOCKERHUB_USERNAME }}/pyth-client-py:latest
41
+ push : ${{ github.event_name != 'pull_request' }}
42
+ tags : ${{ steps.meta.outputs.tags }}
43
+ labels : ${{ steps.meta.outputs.labels }}
28
44
29
45
- name : Image digest
30
46
run : echo ${{ steps.docker_build.outputs.digest }}
You can’t perform that action at this time.
0 commit comments