Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 609c4bb

Browse files
committed
Build Docker images for amd64 & arm64 platforms
1 parent 654472d commit 609c4bb

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

.github/workflows/beeper-ci.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,35 @@ jobs:
6969
DOCKER_BUILDKIT: 1
7070
steps:
7171
- uses: actions/checkout@v2
72+
- uses: docker/setup-qemu-action@v2
7273
- uses: docker/setup-buildx-action@v2
73-
- run: docker login -u ${{ secrets.CI_REGISTRY_USER }} -p ${{ secrets.CI_REGISTRY_PASSWORD }} ${{ secrets.CI_REGISTRY }}
74+
- uses: docker/login-action@v2
75+
with:
76+
registry: ${{ secrets.CI_REGISTRY }}
77+
username: ${{ secrets.CI_REGISTRY_USER }}
78+
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
7479
- run: |-
7580
if [ "${{ github.ref_name }}" = "beeper" ]; then
7681
tag=$(cat pyproject.toml | grep -E "^version =" | sed -E 's/^version = "(.+)"$/\1/');
7782
else
78-
tag="${{ github.ref_name }}";
83+
tag="${{ github.head_ref || github.ref_name }}";
7984
fi
8085
81-
docker build --tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} -f docker/Dockerfile .
82-
docker push ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}
86+
docker buildx build \
87+
--push \
88+
--platform linux/amd64,linux/arm64 \
89+
--tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
90+
-f docker/Dockerfile \
91+
.
92+
93+
echo "Pushed image: synapse:$tag-${{ github.sha }}"
8394
8495
if [ "${{ github.ref_name }}" = "beeper" ]; then
8596
docker tag \
8697
${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
8798
${{ secrets.CI_REGISTRY }}/synapse:latest
8899
docker push ${{ secrets.CI_REGISTRY }}/synapse:latest
100+
echo "Pushed image: synapse:latest"
89101
fi
90102
91103
build-pyston:
@@ -97,18 +109,26 @@ jobs:
97109
DOCKER_BUILDKIT: 1
98110
steps:
99111
- uses: actions/checkout@v2
112+
- uses: docker/setup-qemu-action@v2
100113
- uses: docker/setup-buildx-action@v2
101-
- run: docker login -u ${{ secrets.CI_REGISTRY_USER }} -p ${{ secrets.CI_REGISTRY_PASSWORD }} ${{ secrets.CI_REGISTRY }}
114+
- uses: docker/login-action@v2
115+
with:
116+
registry: ${{ secrets.CI_REGISTRY }}
117+
username: ${{ secrets.CI_REGISTRY_USER }}
118+
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
102119
- run: |-
103120
if [ "${{ github.ref_name }}" = "beeper" ]; then
104121
tag=$(cat pyproject.toml | grep -E "^version =" | sed -E 's/^version = "(.+)"$/\1/');
105122
else
106-
tag="${{ github.ref_name }}";
123+
tag="${{ github.head_ref || github.ref_name }}";
107124
fi
108125
109-
docker build \
126+
docker buildx build \
127+
--push \
128+
--platform linux/amd64,linux/arm64 \
110129
--build-arg BASE_IMAGE=pyston/slim:2.3.3 \
111130
--tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}-pyston \
112-
-f docker/Dockerfile-custom-base .
131+
-f docker/Dockerfile-custom-base \
132+
.
113133
114-
docker push ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}-pyston
134+
echo "Pushed image: synapse:$tag-${{ github.sha }}-pyston"

0 commit comments

Comments
 (0)