Docker Image Build/Publish Manually #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |