-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (115 loc) · 4.26 KB
/
images_alpy.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Publish Docker Images (Alpy)
on:
workflow_call:
inputs:
IMAGE_REGISTRY:
required: false
type: string
default: "ccpgames"
PSYCOPG_VERSION:
required: true
type: string
GRPCIO_IMAGE_VERSION:
required: true
type: string
PROTOPLASM_PY_PKG_VERSION:
required: true
type: string
secrets:
REGISTRY_USER:
required: true
REGISTRY_TOKEN:
required: true
jobs:
alpy_base:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8.18", "3.9.18", "3.10.13", "3.11.8", "3.12.2" ]
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
ALPY_VERSION=`echo ${{ matrix.python-version }} | cut -d. -f1,2`
echo "ALPY_VERSION=$ALPY_VERSION" >> $GITHUB_ENV
echo "HASH_VERSION=${{ hashFiles('requirements.txt', 'docker/alpy/base.Dockerfile') }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/base.Dockerfile
network: host
no-cache: true
push: true
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
tags: |
${{ inputs.IMAGE_REGISTRY }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:${{ inputs.GRPCIO_IMAGE_VERSION }}-${{ env.HASH_VERSION }}
${{ inputs.IMAGE_REGISTRY }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:latest
alpy:
runs-on: ubuntu-latest
needs: [ alpy_base ]
strategy:
matrix:
alpy-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
echo "IMG_FULL=${{ inputs.IMAGE_REGISTRY }}/protoplasm:${{ inputs.PROTOPLASM_PY_PKG_VERSION }}-alpy${{ matrix.alpy-version }}" >> $GITHUB_ENV
echo "HASH_VERSION=${{ hashFiles('requirements.txt', 'docker/alpy/base.Dockerfile') }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/Dockerfile
network: host
no-cache: true
push: true
build-args: |
PACKAGE_VERSION=${{ inputs.PROTOPLASM_PY_PKG_VERSION }}
BASE_IMAGE=${{ inputs.IMAGE_REGISTRY }}/grpcio-alpy${{ matrix.alpy-version }}-base:${{ inputs.GRPCIO_IMAGE_VERSION }}-${{ env.HASH_VERSION }}
tags: |
${{ env.IMG_FULL }}
${{ inputs.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ env.ALPY_VERSION }}
alpy_psycopg:
runs-on: ubuntu-latest
needs: [ alpy ]
strategy:
matrix:
alpy-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
echo "IMG_FULL=${{ inputs.IMAGE_REGISTRY }}/protoplasm:${{ inputs.PROTOPLASM_PY_PKG_VERSION }}-alpy${{ matrix.alpy-version }}-psycopg${{ inputs.PSYCOPG_VERSION }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/psycopg.Dockerfile
network: host
no-cache: true
push: true
build-args: |
BASE_IMAGE=${{ inputs.IMAGE_REGISTRY }}/protoplasm:${{ inputs.PROTOPLASM_PY_PKG_VERSION }}-alpy${{ matrix.alpy-version }}
PSYCOPG_VERSION=${{ inputs.PSYCOPG_VERSION }}
tags: |
${{ env.IMG_FULL }}
${{ inputs.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ matrix.alpy-version }}-psycopg${{ inputs.PROTOPLASM_PY_PKG_VERSION }}
${{ inputs.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ matrix.alpy-version }}-psycopg