Skip to content

Commit 3369b42

Browse files
Fixed buildx for arm64 (#161)
* Fixed buildx for arm64 * Fixed set-outputs
1 parent 3900cde commit 3369b42

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

.github/workflows/build-docker.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
id: branch_name
1616
run: |
1717
GIT_BRANCH=`git symbolic-ref --short HEAD | sed "s/[^[:alnum:].]//g"`
18-
echo "::set-output name=GIT_BRANCH::${GIT_BRANCH}"
18+
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_OUTPUT
1919
- name: Get semantic version
2020
uses: paulhatch/[email protected]
2121
id: versioning
@@ -28,11 +28,11 @@ jobs:
2828
outputs:
2929
version: ${{ github.ref == 'refs/heads/master' && steps.versioning.outputs.version_tag || steps.versioning.outputs.version}}
3030
buildx:
31-
runs-on: ubuntu-latest
31+
runs-on: ubuntu-22.04
3232
needs: [ set_version ]
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v2
35+
uses: actions/checkout@v4
3636
with:
3737
fetch-depth: 0
3838
- name: Set up QEMU
@@ -56,26 +56,18 @@ jobs:
5656
then
5757
DOCKER_PLATFORMS=linux/amd64,linux/arm64
5858
else
59-
DOCKER_PLATFORMS=linux/amd64
59+
DOCKER_PLATFORMS=linux/amd64,linux/arm64
6060
fi
6161
VERSION=${{ needs.set_version.outputs.version }}
6262
6363
TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:latest"
6464
65-
echo ::set-output name=docker_image::${DOCKER_IMAGE}
66-
echo ::set-output name=version::${VERSION}
67-
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
68-
${TAGS} --file ton-http-api/.docker/Dockerfile ton-http-api
69-
70-
echo "Pulling latest image for cache"
71-
IFS=', ' read -r -a PLATFORMS <<< "${DOCKER_PLATFORMS}"
72-
for platform in "${PLATFORMS[@]}"
73-
do
74-
echo "Pulling image for platform ${platform}"
75-
docker pull --platform ${platform} ${{ steps.prepare.outputs.docker_image }}:latest || true
76-
done
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
7768
- name: Docker Buildx (build)
7869
run: |
70+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
7971
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
8072
- name: Login to DockerHub
8173
if: success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)