-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.58 KB
/
docker-image.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
name: Docker Image Build/Publish Manually
on:
workflow_dispatch:
inputs:
commit_id:
description: Shinobi commit id(like 'master' 'dev' '0aef86bd')
required: true
default: dev
image_name:
description: Docker image name(without username)
required: true
default: docker-shinobi
jobs:
build_push:
runs-on: ubuntu-latest
strategy:
matrix:
BRANCH_PREFIX:
- ${{ github.event.inputs.commit_id }}
EXCLUDE_DB:
- 'true'
- 'false'
BASE_IMAGE:
- node:18-buster-slim
- arm32v7/node:18-buster-slim
- arm64v8/node:18-buster-slim
- nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04
include:
- BASE_IMAGE: node:18-buster-slim
ARCH_TYPE: ''
arch_optional: ''
platform: linux/amd64
- BASE_IMAGE: arm32v7/node:18-buster-slim
ARCH_TYPE: arm32v7
arch_optional: ''
platform: linux/arm/v7
- BASE_IMAGE: arm64v8/node:18-buster-slim
ARCH_TYPE: arm64v8
arch_optional: ''
platform: linux/arm64
- BASE_IMAGE: nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04
ARCH_TYPE: nvidia
arch_optional: -nvidia
platform: linux/amd64
- EXCLUDE_DB: 'true'
NO_DB_SUFIX: ''
- EXCLUDE_DB: 'false'
NO_DB_SUFIX: -no-db
steps:
- name: Clone
run: |
git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
cd Shinobi
git checkout ${{ matrix.BRANCH_PREFIX }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: ./Shinobi
build-args: |
EXCLUDE_DB=${{ matrix.EXCLUDE_DB }}
BASE_IMAGE=${{ matrix.BASE_IMAGE }}
platforms: ${{ matrix.platform }}
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/${{ github.event.inputs.image_name }}:${{ matrix.BRANCH_PREFIX }}-${{ matrix.ARCH_TYPE }}${{ matrix.NO_DB_SUFIX }}
${{ secrets.DOCKER_USERNAME }}/${{ github.event.inputs.image_name }}:${{ matrix.BRANCH_PREFIX }}${{ matrix.arch_optional }}${{ matrix.NO_DB_SUFIX }}