42
42
uses : docker/build-push-action@v4
43
43
with :
44
44
context : .
45
- file : ./Dockerfile
46
45
tags : ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
47
46
build-args : |
48
47
DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
@@ -53,35 +52,13 @@ jobs:
53
52
name : commImage
54
53
path : /tmp/commImage.tar
55
54
docker-push :
56
- if : github.event_name != 'pull_request'
57
55
runs-on : ubuntu-latest
58
- needs : build
56
+ if : github.event_name != 'pull_request'
59
57
steps :
60
58
- name : Checkout
61
59
uses : actions/checkout@v2
62
60
- name : Set up Docker Buildx
63
61
uses : docker/setup-buildx-action@v2
64
- - name : Download artifact
65
- uses : actions/download-artifact@v2
66
- with :
67
- name : commImage
68
- path : /tmp
69
- - name : Load Docker image
70
- # Loading the image from artifact should reuse it and rebuild only the missing arm64 version
71
- run : docker load --input /tmp/commImage.tar
72
- - name : Build and push
73
- uses : docker/build-push-action@v4
74
- with :
75
- context : .
76
- file : ./Dockerfile
77
- platforms : linux/amd64,linux/arm64/v8
78
- outputs : type=image,push=false
79
- tags : |
80
- ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
81
- ${{ secrets.MON_IMAGE_NAME }}:latest
82
- ${{ secrets.PUBLIC_IMAGE_NAME }}:latest
83
- build-args : |
84
- DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
85
62
- name : Configure AWS credentials
86
63
uses : aws-actions/configure-aws-credentials@v1
87
64
with :
91
68
- name : Login to Amazon ECR
92
69
id : login-ecr
93
70
uses : aws-actions/amazon-ecr-login@v1
94
- - name : Build and push
95
- run : |
96
- docker push ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
97
- docker push ${{ secrets.MON_IMAGE_NAME }}:latest
98
71
- name : Configure AWS credentials (Public)
99
72
uses : aws-actions/configure-aws-credentials@v1
100
73
with :
@@ -106,9 +79,20 @@ jobs:
106
79
uses : aws-actions/amazon-ecr-login@v1
107
80
with :
108
81
registry-type : public
109
- - name : Push to public
110
- run : |
111
- docker push ${{ secrets.PUBLIC_IMAGE_NAME }}:latest
82
+ # Sadly, buildx does not support loading images from file to reuse the image from the previous step
83
+ # https://github.com/docker/buildx/issues/847
84
+ - name : Build and push
85
+ uses : docker/build-push-action@v4
86
+ with :
87
+ context : .
88
+ platforms : linux/amd64,linux/arm64/v8
89
+ pull : true
90
+ tags : |
91
+ ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
92
+ ${{ secrets.MON_IMAGE_NAME }}:latest
93
+ ${{ secrets.PUBLIC_IMAGE_NAME }}:latest
94
+ build-args : |
95
+ DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
112
96
- name : Logout from Amazon ECR
113
97
if : always()
114
98
run : |
0 commit comments