Skip to content

Build Python Images

Build Python Images #5

Workflow file for this run

name: Build Python Images
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
PYTHON_VERSION: ['3.12', '3.13', '3.14']
PYTHON_UMASK: [false]
include:
- PYTHON_VERSION: 3.15
PYTHON_UNMASK: true
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
docker build \
--build-arg PYTHON_VERSION=${{ matrix.PYTHON_VERSION }} \
--build-arg PYTHON_UMASK=${{ matrix.PYTHON_UNMASK && '1' || '' }} \
--tag ghcr.io/${{ github.repository }}/python:${{ matrix.PYTHON_VERSION }} \
-f ./python-images/base.dockerfile ./python-images/
- name: Push image
run: |
docker push ghcr.io/${{ github.repository }}/python:${{ matrix.PYTHON_VERSION }}