Skip to content

Commit a082380

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 3eb617e + 5244c1c commit a082380

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,52 @@
11
name: Docker
2-
32
on:
43
push:
54
# Publish `master` as Docker `latest` image.
65
branches:
76
- master
8-
97
# Publish `v1.2.3` tags as releases.
108
tags:
119
- v*
12-
1310
# Run tests for any PRs.
1411
pull_request:
15-
1612
env:
1713
# TODO: Change variable to your image's name.
1814
IMAGE_NAME: syncstreamapi
19-
2015
jobs:
2116
# Run tests.
2217
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
2318
test:
2419
runs-on: ubuntu-latest
25-
2620
steps:
2721
- uses: actions/checkout@v2
28-
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v2
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v2
2926
- name: Run tests
3027
run: |
3128
if [ -f docker-compose.test.yml ]; then
3229
docker-compose --file docker-compose.test.yml build
3330
docker-compose --file docker-compose.test.yml run sut
3431
else
35-
docker build . --file Dockerfile
32+
docker buildx build . --file Dockerfile --platform linux/amd64,linux/arm64
3633
fi
3734
# Push image to GitHub Packages.
3835
# See also https://docs.docker.com/docker-hub/builds/
3936
push:
4037
# Ensure test job passes before pushing image.
4138
needs: test
42-
4339
runs-on: ubuntu-latest
4440
if: github.event_name == 'push'
45-
4641
steps:
4742
- uses: actions/checkout@v2
48-
49-
- name: Build image
50-
run: docker build . --file Dockerfile --tag $IMAGE_NAME
51-
43+
- name: Set up QEMU
44+
uses: docker/setup-qemu-action@v2
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v2
5247
- name: Log into registry
5348
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
54-
55-
- name: Push image
49+
- name: Build and push image
5650
run: |
5751
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
5852
@@ -66,5 +60,10 @@ jobs:
6660
[ "$VERSION" == "master" ] && VERSION=latest
6761
echo IMAGE_ID=$IMAGE_ID
6862
echo VERSION=$VERSION
69-
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
70-
docker push $IMAGE_ID:$VERSION
63+
64+
# Build and push multi-arch image
65+
docker buildx build . \
66+
--platform linux/amd64,linux/arm64 \
67+
--file Dockerfile \
68+
--tag $IMAGE_ID:$VERSION \
69+
--push

0 commit comments

Comments
 (0)