Skip to content

Commit fa92bf9

Browse files
Changed buildx to GH action
1 parent eacd1e0 commit fa92bf9

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

.github/workflows/build-docker.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,38 @@ jobs:
5151
id: prepare
5252
run: |
5353
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
54+
DOCKER_PLATFORMS=linux/amd64,linux/arm64
6155
VERSION=${{ needs.set_version.outputs.version }}
62-
6356
TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:latest"
6457
6558
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
6659
echo "version=${VERSION}" >> $GITHUB_OUTPUT
6760
echo "buildx_args=--platform ${DOCKER_PLATFORMS} --no-cache ${TAGS} --file ton-http-api/.docker/Dockerfile ton-http-api" >> $GITHUB_OUTPUT
6861
- name: Login to DockerHub
69-
if: success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
62+
if: success()
7063
uses: docker/login-action@v3
7164
with:
7265
username: ${{ secrets.DOCKER_USERNAME }}
7366
password: ${{ secrets.DOCKER_PASSWORD }}
74-
- name: Docker Buildx (build)
75-
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 }}
67+
- name: Docker Buildx
68+
if: success()
69+
uses: docker/build-push-action@v6
70+
with:
71+
platforms: linux/amd64,linux/arm64
72+
push: github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
73+
context: ./ton-http-api
74+
file: ./ton-http-api/.docker/Dockerfile
75+
tags: toncenter/ton-http-api:${{ needs.set_version.outputs.version }},toncenter/ton-http-api:latest
76+
# - name: Docker Buildx (build)
77+
# if: success() && !(github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master')
78+
# run: |
79+
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
80+
# docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
81+
# - name: Docker Buildx (push)
82+
# if: success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
83+
# run: |
84+
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
85+
# docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
8486
- name: Inspect image
8587
if: always() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'
8688
run: |

0 commit comments

Comments
 (0)