Update base Python container images #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update base Python container images" | |
on: | |
schedule: | |
- cron: '0 0 * * MON' | |
workflow_dispatch: | |
jobs: | |
task: | |
strategy: | |
matrix: | |
py_version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Auth to Cloud | |
uses: 'uwit-iam/action-auth-artifact-registry@main' | |
with: | |
credentials: "${{ secrets.MCI_GCLOUD_AUTH_JSON }}" | |
enable_private_docker: true | |
- name: Record timestamp for image | |
id: timestamp | |
run: | | |
echo "value=$(date +%Y.%m.%d.%H.%M.%S)" >> $GITHUB_OUTPUT # e.g., 2024.01.17.15.09.31 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push to GAR | |
env: | |
image_uri: "us-docker.pkg.dev/uwit-mci-iam/containers/base-python-${{ matrix.py_version }}" | |
uses: docker/build-push-action@v6 | |
with: | |
context: "{{defaultContext}}:images/python-base" | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
PYTHON_VERSION=${{ matrix.py_version }} | |
TIMESTAMP=${{ steps.timestamp.outputs.value }} | |
push: true | |
tags: | | |
${{ env.image_uri }}:latest | |
${{ env.image_uri }}:${{ steps.timestamp.outputs.value }} |