Skip to content

nightly Publish Docker Image #89

nightly Publish Docker Image

nightly Publish Docker Image #89

name: nightly Publish Docker Image
on:
schedule:
- cron: '0 16 * * *'
workflow_dispatch:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get the date
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Build and push Docker image with `latest` tag and nightly tag
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: lfglfg11/lobe-chat:latest, lfglfg11/lobe-chat:nightly-${{ env.TODAY }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha, prefix=lobe-chat
cache-to: type=gha, prefix=lobe-chat, mode=max