-
Notifications
You must be signed in to change notification settings - Fork 31
58 lines (55 loc) · 1.59 KB
/
build-containers-test.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: Build the containers
on:
pull_request:
defaults:
run:
shell: bash
jobs:
build-containers:
name: build-containers
runs-on: ubuntu-latest
strategy:
fail-fast: false # keep running if one leg fails
matrix:
dockerfile:
- Dockerfile-ray-node
- gateway/Dockerfile
python:
- "3.8"
- "3.9"
- "3.10"
exclude:
# gateway is only built using python 3.9
- dockerfile: gateway/Dockerfile
python: "3.8"
- dockerfile: gateway/Dockerfile
python: "3.10"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Config python value
run: |
python_version=${{ matrix.python }}
dockerfile=${{ matrix.dockerfile }}
# ray-node image uses different string for python version
if [[ "$dockerfile" == *"ray-node" ]]
then
new_version=${python_version//.}
echo "python_version=py$new_version" >> "$GITHUB_ENV"
else
echo "python_version=$python_version" >> "$GITHUB_ENV"
fi
- name: Build ${{ matrix.dockerfile }} using python ${{ matrix.python }}
uses: docker/build-push-action@v5
with:
context: .
file: ./${{ matrix.dockerfile }}
load: true
tags: image:test
build-args:
IMAGE_PY_VERSION=${{ env.python_version }}
- name: Inspect
run: |
docker image inspect image:test