-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (49 loc) · 1.37 KB
/
build-docker.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
name: Docker Build
run-name: Docker Build (${{ github.event.inputs.target }})
on:
workflow_dispatch:
inputs:
target:
type: choice
description: Build Target
options:
- compiled
- base
env:
REGISTRY: ghcr.io
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Print Mode
run: |
echo "Mode: ${{ github.event.inputs.target }}" >> $GITHUB_STEP_SUMMARY
- name: Checkout
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Base Image
if: github.event.inputs.target == 'base'
uses: docker/build-push-action@v5
with:
push: true
build-args: |
MODE=base
IMAGE=nvidia/cuda:11.8.0-devel-ubuntu22.04
tags: ${{ env.REGISTRY }}/${{ github.repository }}-base:latest
- name: Build Compiled Image
if: github.event.inputs.target == 'compiled'
uses: docker/build-push-action@v5
with:
push: true
build-args: |
MODE=compiled
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-base:latest
tags: ${{ env.REGISTRY }}/${{ github.repository }}-compiled:latest