-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.51 KB
/
update-base-python-images.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 }}