Files
inference-worker/.github/workflows/build-and-push.yml
T

57 lines
1.8 KiB
YAML

name: 📦 Build custom Docker image and push to Docker Hub
# Workflow triggered manually (GitHub UI) or programmatically by the check-ollama-new-release workflow
on:
workflow_call:
inputs:
ollama_version:
description: 'ollama version to build. Example: 1.20.0'
required: true
type: string
next_version_suffix:
description: 'Next version suffix to compare with the new release. Example: 0'
required: false
type: string
workflow_dispatch:
inputs:
ollama_version:
description: 'ollama version to build. Example: 1.20.0'
required: true
type: string
next_version_suffix:
description: 'Next version suffix to compare with the new release. Example: 0'
required: false
type: string
jobs:
build-push-docker-image:
name: 🐳 Build and push Docker image
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: ./wrapper
build-args: OLLAMA_VERSION=${{ inputs.ollama_version }}
push: true
tags: svenbrnn/runpod-ollama:${{ inputs.ollama_version }}${{ inputs.next_version_suffix }},svenbrnn/runpod-ollama:latest
create-release:
name: 🏷️ Create GitHub Release
needs: build-push-docker-image
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
contents: write
steps:
- uses: ncipollo/release-action@v1
with:
commit: main
tag: ollama@${{ inputs.ollama_version }}${{ inputs.next_version_suffix }}