1+ name : DEV - build & publish Arduino dev-latest containers
2+
3+ on :
4+ workflow_dispatch :
5+
6+ env :
7+ REGISTRY : ghcr.io
8+ DEV_REGISTRY_PATH : ghcr.io/${{ github.repository_owner }}/
9+
10+ permissions :
11+ contents : write
12+ packages : write
13+ id-token : write
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+ env :
19+ PYTHON_VERSION : " 3.13"
20+ TASKFILE_VERSION : " 3.45.4"
21+ TASKFILE_PATH : " /home/runner/go/bin"
22+ strategy :
23+ fail-fast : false
24+ matrix :
25+ include :
26+ - dockerfile : ./containers/python-apps-base/Dockerfile
27+ context : ./containers/python-apps-base
28+ image : ghcr.io/${{ github.repository_owner }}/app-bricks/python-apps-base
29+ build_python_package : true
30+ - dockerfile : ./containers/ei-models-runner/Dockerfile
31+ context : ./containers/ei-models-runner
32+ image : ghcr.io/${{ github.repository_owner }}/app-bricks/ei-models-runner
33+ build_python_package : false
34+ max-parallel : 2
35+
36+ steps :
37+ - name : Checkout repository
38+ uses : actions/checkout@v4
39+
40+ - name : Set up Python
41+ uses : actions/setup-python@v5
42+ if : matrix.build_python_package
43+ with :
44+ python-version : ${{ env.PYTHON_VERSION }}
45+
46+ - name : Install and build library
47+ if : matrix.build_python_package
48+ env :
49+ PUBLIC_IMAGE_REGISTRY_BASE : ${{ env.DEV_REGISTRY_PATH }}/
50+ run : |
51+ pip install go-task-bin==${{ env.TASKFILE_VERSION }}
52+ task init:ci
53+ task build-dev
54+ cp ./dist/arduino*.whl ./containers/python-apps-base/
55+
56+ # Add support for more platforms with QEMU
57+ - name : Set up QEMU
58+ uses : docker/setup-qemu-action@v3
59+ with :
60+ platforms : linux/arm64
61+
62+ - name : Setup Docker buildx
63+ uses : docker/setup-buildx-action@v3
64+
65+ - name : Log into registry ${{ env.REGISTRY }}
66+ uses : docker/login-action@v3
67+ with :
68+ registry : ${{ env.REGISTRY }}
69+ username : ${{ github.repository_owner }}
70+ password : ${{ secrets.GITHUB_TOKEN }}
71+
72+ # Extract metadata from the GitHub context
73+ - name : Extract Docker metadata
74+ id : meta
75+ uses : docker/metadata-action@v5
76+ with :
77+ tags : |
78+ type=raw,value=dev-latest,enable=true
79+ images : ${{ matrix.image }}
80+
81+ # Build and push Docker image with Buildx (don't push on PR)
82+ - name : Build and push Docker image
83+ id : build-and-push
84+ uses : docker/build-push-action@v6
85+ with :
86+ context : ${{ matrix.context }}
87+ file : ${{ matrix.dockerfile }}
88+ push : true
89+ tags : ${{ steps.meta.outputs.tags }}
90+ labels : ${{ steps.meta.outputs.labels }}
91+ platforms : linux/arm64
92+ cache-from : type=gha
93+ cache-to : type=gha,mode=max
94+ provenance : false
95+ build-args : |
96+ REGISTRY=${{ env.DEV_REGISTRY_PATH }}
0 commit comments