mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
106be03ba8
2539: Update Docker credentials r=curquiza a=curquiza This is to avoid using the tpayet credentials and use `@meili-bot` credentials instead. The `DOCKER_USERNAME` and `DOCKER_PASSWORD` are still present as secret, I will remove them once v0.28.0 is fully merged (they are still used on `release-v0.28.0`) I tested by created a tag on the branch, it worked: the tag was pushed to docker hub by meili-bot Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
---
|
|
on:
|
|
schedule:
|
|
- cron: '0 4 * * *' # Every day at 4:00am
|
|
push:
|
|
tags:
|
|
- '*'
|
|
release:
|
|
types: [released]
|
|
|
|
name: Publish tagged images to Docker Hub
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to DockerHub
|
|
if: github.event_name != 'schedule'
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Check tag format
|
|
id: check-tag-format
|
|
run: |
|
|
# Escape submitted tag name
|
|
escaped_tag=$(printf "%q" ${{ github.ref_name }})
|
|
|
|
# Check if tag has format v<nmumber>.<number>.<number> and set output.match
|
|
# to create a vX.Y (without patch version) Docker tag
|
|
if [[ $escaped_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo ::set-output name=match::true
|
|
else
|
|
echo ::set-output name=match::false
|
|
fi
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: getmeili/meilisearch
|
|
# The lastest tag is only pushed for the official Meilisearch release
|
|
# See https://github.com/docker/metadata-action#latest-tag
|
|
flavor: latest=false
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=semver,pattern=v{{major}}.{{minor}},enable=${{ steps.check-tag-format.outputs.match }}
|
|
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
|
|
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
# 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 }}
|