@@ -17,36 +17,32 @@ jobs:
1717 push :
1818 runs-on : ubuntu-latest
1919 if : github.event_name == 'push'
20-
21- permissions :
22- contents : read
23- packages : write
20+ env :
21+ DOCKER_CLI_EXPERIMENTAL : " enabled"
2422
2523 steps :
2624 - uses : actions/checkout@v2
27-
28- - name : Build image
29- run : docker build . --file ./$VERSION/Dockerfile --tag $IMAGE_NAME
3025
26+ - name : Set up QEMU
27+ uses : docker/setup-qemu-action@v1
28+
29+ - name : Set up Docker Buildx
30+ id : buildx
31+ uses : docker/setup-buildx-action@v1
32+ with :
33+ install : true
3134
3235 - name : Login to GitHub Container Registry
3336 uses : docker/login-action@v1
3437 with :
3538 registry : ghcr.io
36- username : ${{ github.actor }}
39+ username : ${{ github.repository_owner }}
3740 password : ${{ secrets.GITHUB_TOKEN }}
3841
39- - name : Push image
40- run : |
41- IMAGE_ID=ghcr.io/vulpemventures/$IMAGE_NAME
42-
43- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
44-
45- echo IMAGE_ID=$IMAGE_ID
46- echo VERSION=$VERSION
47-
48- docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
49- docker push $IMAGE_ID:$VERSION
50-
51- docker tag $IMAGE_NAME $IMAGE_ID:latest
52- docker push $IMAGE_ID:latest
42+ - name : Build image
43+ run : >-
44+ docker buildx build --push
45+ --file ./$VERSION/Dockerfile
46+ --tag ghcr.io/vulpemventures/$IMAGE_NAME:latest
47+ --tag ghcr.io/vulpemventures/$IMAGE_NAME:$VERSION
48+ --platform linux/arm64,linux/amd64 .
0 commit comments