Add schedule to the CI

This commit is contained in:
Clémentine Urquizar 2022-06-09 11:50:20 +02:00
parent 39a1dcb32c
commit 4a494ad2fa
No known key found for this signature in database
GPG Key ID: D8E7CC7422E77E1A
1 changed files with 7 additions and 3 deletions

View File

@ -1,12 +1,14 @@
---
on:
schedule:
- cron: '0 4 * * *' # Every day at 4:00am
push:
tags:
- '*'
release:
types: [released]
name: Publish tagged image to Docker Hub
name: Publish tagged images to Docker Hub
jobs:
docker:
@ -19,6 +21,7 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'schedule'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
@ -29,7 +32,7 @@ jobs:
uses: docker/metadata-action@v3
with:
images: getmeili/meilisearch
# Output 'latest' tag only when 'release' happen, instead of when 'push tag' event happend (default behavior).
# The lastest tag is only pushed for the official Meilisearch release
# See https://github.com/docker/metadata-action#latest-tag
flavor: latest=false
tags: |
@ -40,6 +43,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
# We do not push tags for the cron jobs, this is only for test purposes
push: ${{ github.event_name != 'schedule' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}