File tree Expand file tree Collapse file tree 3 files changed +50
-10
lines changed Expand file tree Collapse file tree 3 files changed +50
-10
lines changed Original file line number Diff line number Diff line change
1
+
2
+ name : ci-docker-multi-arch
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v[0-9].[0-9]+.[0-9]+*"
7
+
8
+ jobs :
9
+ docker :
10
+ name : Build base image
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Checkout
14
+ uses : actions/checkout@v4
15
+ - name : Set up QEMU
16
+ uses : docker/setup-qemu-action@v3
17
+
18
+ - name : Set up Docker Buildx
19
+ uses : docker/setup-buildx-action@v3
20
+
21
+ - name : Login to Docker Hub
22
+ uses : docker/login-action@v3
23
+ with :
24
+ username : ${{ secrets.DOCKER_HUB_USER }}
25
+ password : ${{ secrets.DOCKER_HUB_TOKEN }}
26
+
27
+ - name : Get Release Tag
28
+ run : |
29
+ TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
30
+ echo "VERSION=$(echo $TAG | sed 's/v//')" >> $GITHUB_ENV
31
+ - name : Build and push
32
+ uses : docker/build-push-action@v6
33
+ with :
34
+ context : ./deploy/docker
35
+ push : true
36
+ tags : daxaai/pebblo:${{ env.VERSION }}
37
+ platforms : linux/amd64,linux/arm64
38
+ file : ./deploy/docker/Dockerfile.base
39
+ build-args : |
40
+ "build_image=python:3.11"
41
+ "base_image=python:3.11"
42
+ "pebblo_branch=${{ env.VERSION }}"
Original file line number Diff line number Diff line change 1
1
name : Docker image release
2
2
3
3
on :
4
- push :
5
- tags :
6
- - " v[0-9].[0-9]+.[0-9]+*"
4
+ workflow_dispatch :
7
5
jobs :
8
6
build-and-push :
9
7
name : Build base image
Original file line number Diff line number Diff line change 1
- ARG build_image
2
- ARG base_image
3
- ARG pebblo_version
1
+ ARG build_image=python:3.11
2
+ ARG base_image=python:3.11
3
+ ARG pebblo_branch=main
4
4
5
- FROM $build_image AS base
5
+ FROM --platform=$BUILDPLATFORM $build_image AS base
6
6
7
7
RUN mkdir /opt/pebblo && apt-get update && \
8
8
apt-get install -y --no-install-recommends \
@@ -11,12 +11,12 @@ RUN mkdir /opt/pebblo && apt-get update && \
11
11
12
12
WORKDIR /opt/pebblo
13
13
14
- RUN git clone https://github.com/daxa-ai/pebblo.git /opt/pebblo && git checkout $pebblo_version
14
+ RUN git clone https://github.com/daxa-ai/pebblo.git /opt/pebblo && git checkout $pebblo_branch
15
15
16
- RUN pip install weasyprint && pip install build && python -m build --wheel && pip install dist/*.whl
16
+ RUN pip install weasyprint build && python -m build --wheel && pip install dist/*.whl
17
17
18
18
# Stage 2
19
- FROM $base_image
19
+ FROM --platform=$BUILDPLATFORM $base_image
20
20
21
21
RUN mkdir /opt/pebblo /opt/.pebblo /opt/pebblo/log /opt/pebblo/config
22
22
You can’t perform that action at this time.
0 commit comments