Skip to content

feat: update AI container images references (#2) #1

feat: update AI container images references (#2)

feat: update AI container images references (#2) #1

name: BRICKS Container Release - Build and Publish
on:
workflow_dispatch:
push:
tags:
- "release/*"
env:
GHCR_REGISTRY: ghcr.io
GHCR_DESTINATION_ORG: ghcr.io/arduino
GH_DESTINATION_REPO: https://github.com/arduino/app-bricks-py
permissions:
contents: write
packages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.13'
TASKFILE_VERSION: 'v3.44.0'
TASKFILE_PATH: '/home/runner/go/bin'
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./containers/python-apps-base/Dockerfile
context: ./containers/python-apps-base
image: /app-bricks/python-apps-base
build_python_package: true
max-parallel: 1
steps:
- name: Log into ${{ env.GHCR_REGISTRY }} registry
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
if: matrix.build_python_package
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install and build library
if: matrix.build_python_package
env:
PUBLIC_IMAGE_REGISTRY_BASE: ${{ env.GHCR_DESTINATION_ORG }}/
run: |
which task || curl -sSfL https://taskfile.dev/install.sh | sh -s -- -b ${{ env.TASKFILE_PATH }} ${{ env.TASKFILE_VERSION }}
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task init:ci
task build
cp ./dist/arduino*.whl ./containers/python-apps-base/
- name: Upload release asset
if: matrix.build_python_package
uses: softprops/action-gh-release@v2
with:
files: |
dist/arduino*.whl
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Add support for more platforms with QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
# Extract metadata from the GitHub context
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=match,pattern=release\/(.*),group=1
images: |
${{ env.GHCR_DESTINATION_ORG }}${{ matrix.image }}
labels: |
org.opencontainers.image.source=${{ env.GH_DESTINATION_REPO}}
org.opencontainers.image.url=${{ env.GH_DESTINATION_REPO}}
# Build and push Docker image with Buildx (don't push on PR)
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
build-args: |
# Set the base image registry. This is used to build the image only.
REGISTRY=ghcr.io/arduino/