Skip to content

nightly Publish Docker Image #251

nightly Publish Docker Image

nightly Publish Docker Image #251

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: yangclivia/lobe-chat:latest, yangclivia/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