-
Notifications
You must be signed in to change notification settings - Fork 31
74 lines (72 loc) · 2.58 KB
/
icr-image-build-and-push.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: ICR | build and push
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for images'
required: true
release:
types: [published]
jobs:
icr_build_and_push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- imagename: quantum-serverless-ray-node
pythonversion: py38
dockerfile: Dockerfile-ray-node
platforms: linux/amd64
- imagename: quantum-serverless-ray-node
pythonversion: py39
dockerfile: Dockerfile-ray-node
platforms: linux/amd64,linux/arm64
- imagename: quantum-serverless-ray-node
pythonversion: py310
dockerfile: Dockerfile-ray-node
platforms: linux/amd64
- imagename: quantum-repository-server
pythonversion: ''
dockerfile: ./repository/Dockerfile
platforms: linux/amd64,linux/arm64
- imagename: quantum-serverless-gateway
pythonversion: ''
dockerfile: ./gateway/Dockerfile
platforms: linux/amd64,linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to IBM Container Registry
uses: docker/login-action@v2
with:
registry: icr.io
username: iamapikey
password: ${{ secrets.IBMCLOUD_API_KEY }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,amd64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push on dispatch
if : github.event_name == 'workflow_dispatch'
uses: ./.github/actions/icr-build-and-push-images
with:
tag: ${{ github.event.inputs.tag }}
name: ${{ matrix.imagename }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
pythonversion: ${{ matrix.pythonversion }}
- name: Set version from tag
if : github.event_name == 'release' && github.event.action == 'published'
id: set-version-from-tag
run: echo "VERSION=${GITHUB_REF_NAME/v}" >> $GITHUB_OUTPUT
- name: Build and push on release
if : github.event_name == 'release' && github.event.action == 'published'
uses: ./.github/actions/icr-build-and-push-images
with:
tag: ${{ steps.set-version-from-tag.outputs.VERSION }}
name: ${{ matrix.imagename }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
pythonversion: ${{ matrix.pythonversion }}