46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: CD | Docker-Build-Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
image_tag:
|
|
description: "Docker Image Tag"
|
|
required: false
|
|
default: "dev"
|
|
|
|
jobs:
|
|
docker-build:
|
|
runs-on: DO
|
|
# DO is a custom runner deployed on DigitalOcean, only available for workflows under the runpod-workers organization.
|
|
# If you would like to use this workflow, you can replace DO with ubuntu-latest or any other runner.
|
|
|
|
strategy:
|
|
matrix:
|
|
cuda_version: [11.8.0, 12.1.0]
|
|
|
|
steps:
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
# Build and push step
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
push: true
|
|
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag) || 'dev' }}-cuda${{ matrix.cuda_version }}
|
|
build-args: WORKER_CUDA_VERSION=${{ matrix.cuda_version }}
|