Skip to content

Update Mirror Image of LocalAI #73

Update Mirror Image of LocalAI

Update Mirror Image of LocalAI #73

name: Update Mirror Image of LocalAI
on:
workflow_dispatch:
schedule:
- cron: '0 */4 * * *'
jobs:
push_cpu_to_hub:
name: Push LocalAI CPU to Docker Hub
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/midori_ai_subsystem_localai_cpu
- name: Make Ver Tags (tags, labels) for Docker
id: sha
uses: docker/metadata-action@master
with:
images: lunamidori5/midori_ai_subsystem_localai_cpu
tags: |
type=sha,enable=true,priority=100,prefix={{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}-sha-,suffix=,format=short
- name: Build and push CPU LocalAI Docker image
uses: docker/build-push-action@master
with:
context: ./other_files/subsystem_docker_stuff/localai/
file: ./other_files/subsystem_docker_stuff/localai/localai-subsystem-dockerfile-cpu
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push CPU LocalAI Docker image
uses: docker/build-push-action@master
with:
context: ./other_files/subsystem_docker_stuff/localai/
file: ./other_files/subsystem_docker_stuff/localai/localai-subsystem-dockerfile-cpu
push: true
tags: ${{ steps.sha.outputs.tags }}
labels: ${{ steps.sha.outputs.labels }}
- name: Clean up Docker Cache
run: |
docker image prune -f
push_gpu_to_hub:
name: Push LocalAI GPU to Docker Hub
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: lunamidori5/midori_ai_subsystem_localai_gpu
- name: Make Ver Tags (tags, labels) for Docker
id: sha
uses: docker/metadata-action@master
with:
images: lunamidori5/midori_ai_subsystem_localai_gpu
tags: |
type=sha,enable=true,priority=100,prefix={{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}-sha-,suffix=,format=short
- name: Build and push GPU LocalAI Docker image
uses: docker/build-push-action@master
with:
context: ./other_files/subsystem_docker_stuff/localai/
file: ./other_files/subsystem_docker_stuff/localai/localai-subsystem-dockerfile-gpu
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push GPU LocalAI Docker image
uses: docker/build-push-action@master
with:
context: ./other_files/subsystem_docker_stuff/localai/
file: ./other_files/subsystem_docker_stuff/localai/localai-subsystem-dockerfile-gpu
push: true
tags: ${{ steps.sha.outputs.tags }}
labels: ${{ steps.sha.outputs.labels }}
- name: Clean up Docker Cache
run: |
docker image prune -f