@@ -47,41 +47,31 @@ jobs:
47
47
echo "Status: ${{ steps.buildx.outputs.status }}"
48
48
echo "Flags: ${{ steps.buildx.outputs.flags }}"
49
49
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
50
- - name : Prepare
51
- id : prepare
52
- run : |
53
- DOCKER_IMAGE=toncenter/ton-http-api
54
-
55
- if ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
56
- then
57
- DOCKER_PLATFORMS=linux/amd64,linux/arm64
58
- else
59
- DOCKER_PLATFORMS=linux/amd64,linux/arm64
60
- fi
61
- VERSION=${{ needs.set_version.outputs.version }}
62
-
63
- TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:latest"
64
-
65
- echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
66
- echo "version=${VERSION}" >> $GITHUB_OUTPUT
67
- echo "buildx_args=--platform ${DOCKER_PLATFORMS} --no-cache ${TAGS} --file ton-http-api/.docker/Dockerfile ton-http-api" >> $GITHUB_OUTPUT
68
50
- name : Login to DockerHub
69
- if : success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
51
+ if : success()
70
52
uses : docker/login-action@v3
71
53
with :
72
54
username : ${{ secrets.DOCKER_USERNAME }}
73
55
password : ${{ secrets.DOCKER_PASSWORD }}
74
56
- name : Docker Buildx (build)
75
57
if : success() && !(github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master')
76
- run : |
77
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
78
- docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
79
- - name : Docker Buildx (push)
80
- if : success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
81
- run : |
82
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
83
- docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
58
+ uses : docker/build-push-action@v6
59
+ with :
60
+ platforms : linux/amd64,linux/arm64
61
+ push : false
62
+ context : ./ton-http-api
63
+ file : ./ton-http-api/.docker/Dockerfile
64
+ tags : toncenter/ton-http-api:${{ needs.set_version.outputs.version }}
65
+ - name : Docker Buildx (build and push)
66
+ if : success() && (github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master')
67
+ uses : docker/build-push-action@v6
68
+ with :
69
+ platforms : linux/amd64,linux/arm64
70
+ push : true
71
+ context : ./ton-http-api
72
+ file : ./ton-http-api/.docker/Dockerfile
73
+ tags : toncenter/ton-http-api:${{ needs.set_version.outputs.version }},toncenter/ton-http-api:latest
84
74
- name : Inspect image
85
75
if : always() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
86
76
run : |
87
- docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }} :${{ steps.prepare.outputs.version }}
77
+ docker buildx imagetools inspect toncenter/ton-http-api :${{ steps.prepare.outputs.version }}
0 commit comments