@@ -13,29 +13,37 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
-
16
- name : Login to DockerHub
17
- # The job will terminate early if Docker Hub credentials is not set.
18
- uses : docker/login-action@v1
16
+ name : Checkout
17
+ uses : actions/checkout@v3
18
+ -
19
+ name : Docker meta
20
+ uses : docker/metadata-action@v4
21
+ id : meta
22
+ with :
23
+ images : |
24
+ fossasia/open-event-frontend
25
+ tags : |
26
+ type=ref,event=branch
27
+ type=ref,event=pr
28
+ type=semver,pattern={{version}}
29
+ type=semver,pattern={{major}}.{{minor}}
30
+ -
31
+ name : Login to Docker Hub
32
+ uses : docker/login-action@v2
19
33
with :
20
34
username : ${{ secrets.DOCKERHUB_USERNAME }}
21
35
password : ${{ secrets.DOCKERHUB_TOKEN }}
22
36
-
23
- name : Set up Docker Buildx
24
- uses : docker/setup-buildx -action@v1
37
+ name : Set up QEMU
38
+ uses : docker/setup-qemu -action@v2
25
39
-
26
- name : Docker meta
27
- uses : docker/metadata-action@v3
28
- id : meta
29
- with :
30
- images : fossasia/open-event-frontend
40
+ name : Set up Buildx
41
+ uses : docker/setup-buildx-action@v2
31
42
-
32
- name : Build
33
- id : docker_build
34
- uses : docker/build-push-action@v2
43
+ name : Build and push
44
+ uses : docker/build-push-action@v4
35
45
with :
36
- push : true
46
+ context : .
47
+ push : ${{ github.event_name != 'pull_request' }}
37
48
tags : ${{ steps.meta.outputs.tags }}
38
49
labels : ${{ steps.meta.outputs.labels }}
39
- -
40
- name : Image digest
41
- run : echo ${{ steps.docker_build.outputs.digest }}
0 commit comments