Skip to content

Commit 07dae4b

Browse files
committed
make multi arch builder
1 parent 91bdf2f commit 07dae4b

1 file changed

Lines changed: 32 additions & 17 deletions

File tree

.github/workflows/release.yaml

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,31 +66,46 @@ jobs:
6666
build-docker:
6767
runs-on: ubuntu-latest
6868

69+
permissions:
70+
contents: read
71+
packages: write
72+
6973
steps:
7074
- uses: actions/checkout@v4
71-
- uses: docker/setup-buildx-action@v3
75+
76+
# Enable QEMU (for ARM builds)
77+
- name: Set up QEMU
78+
uses: docker/setup-qemu-action@v3
79+
80+
# Enable Buildx
81+
- name: Set up Docker Buildx
82+
uses: docker/setup-buildx-action@v3
83+
84+
# Login to GHCR
85+
- name: Login to GHCR
86+
uses: docker/login-action@v2
87+
with:
88+
registry: ghcr.io
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GITHUB_TOKEN }}
91+
92+
# Set image tag
7293
- name: Set Docker image tag
73-
id: image_tag
7494
run: |
7595
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
7696
echo "IMAGE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
7797
else
7898
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
7999
fi
80-
- name: Build Docker image
81-
run: |
82-
docker build \
83-
-f Dockerfile \
84-
--build-arg="VERSION=${IMAGE_TAG}" --build-arg="COMMIT=$(git rev-parse --short HEAD)" --build-arg="BUILDDATE=$(date +%Y-%m-%d)" \
85-
-t ghcr.io/${{ github.repository_owner }}/telepath:${IMAGE_TAG} .
86100
87-
- name: Push Docker image
88-
uses: docker/login-action@v2
89-
with:
90-
registry: ghcr.io
91-
username: ${{ github.actor }}
92-
password: ${{ secrets.GITHUB_TOKEN }}
93-
94-
- name: Push image
101+
# Multi-arch build + push
102+
- name: Build and Push Multi-Arch Image
95103
run: |
96-
docker push ghcr.io/${{ github.repository_owner }}/telepath:${IMAGE_TAG}
104+
docker buildx build \
105+
--platform linux/amd64,linux/arm64,linux/arm/v7 \
106+
-f Dockerfile \
107+
--build-arg VERSION=${IMAGE_TAG} \
108+
--build-arg COMMIT=$(git rev-parse --short HEAD) \
109+
--build-arg BUILDDATE=$(date +%Y-%m-%d) \
110+
-t ghcr.io/${{ github.repository_owner }}/telepath:${IMAGE_TAG} \
111+
--push .

0 commit comments

Comments
 (0)