-
Notifications
You must be signed in to change notification settings - Fork 72
82 lines (74 loc) · 2 KB
/
build.yml
File metadata and controls
82 lines (74 loc) · 2 KB
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
# How to run manually:
# 1. Go to the GitHub repository.
# 2. Click the "Actions" tab.
# 3. Select this workflow, "docker publish".
# 4. Click "Run workflow".
# 5. Choose the desired inputs, then click "Run workflow".
name: docker publish
on:
workflow_dispatch:
inputs:
env:
description: "Deployment environment"
required: true
default: "prod"
type: choice
options:
- prod
- staging
target:
description: "Which image(s) to build"
required: true
default: "all"
type: choice
options:
- all
- gpu
- rocm
- cpu-amd64
- cpu-arm64
jobs:
build-and-push:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
# Uses Dockerfile.gpu
- name: gpu
platform: gpu
arch: ""
# Uses Dockerfile.rocm
- name: rocm
platform: rocm
arch: ""
# Uses Dockerfile.cpu
- name: cpu-amd64
platform: cpu
arch: ""
# Uses Dockerfile.arm
- name: cpu-arm64
platform: arm
arch: linux/arm64
steps:
- name: Set up QEMU
if: ${{ matrix.arch == 'linux/arm64' }}
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build and push Docker image
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == matrix.name }}
run: make push-docker
env:
ENV: ${{ github.event.inputs.env }}
PLATFORM: ${{ matrix.platform }}
ARCH: ${{ matrix.arch }}