Skip to content

First commit

First commit #1

name: BASE - build Python base image
on:
workflow_dispatch:
push:
tags:
- "base/*"
env:
GHCR_REGISTRY: ghcr.io
REPO: app-bricks/python-base
permissions:
contents: write
packages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./containers/python-base/Dockerfile
context: ./containers/python-base
max-parallel: 2
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
#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=raw,value=latest,enable=true
type=match,pattern=base\/(.*),group=1
images: |
${{ env.GHCR_REGISTRY }}/arduino/${{ env.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