-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.34 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
name: "Update base Python container images"
on:
push:
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 }}"
- 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: Build and push docker image
env:
image_uri: "us-docker.pkg.dev/uwit-mci-iam/containers/base-python-${{ matrix.py_version }}"
run: |
docker build \
images/python-base/ \
-f images/python-base/Dockerfile \
-t "${{ env.image_uri }}:latest" \
-t "${{ env.image_uri }}:${{ steps.timestamp.outputs.value }}" \
--build-arg TIMESTAMP="${{ steps.timestamp.outputs.value }}" \
--build-arg PYTHON_VERSION="${{ matrix.py_version }}"
docker push --all-tags "${{ env.image_uri }}"