meilisearch/.github/workflows/publish-docker.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

---
on:
push:
tags:
- '*'
release:
types: [released]
name: Publish tagged image to Docker Hub
jobs:
docker:
2021-12-22 01:32:29 +08:00
runs-on: docker
steps:
2021-11-11 22:57:06 +08:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-11-12 02:42:30 +08:00
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
2021-11-11 22:57:06 +08:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
2021-11-12 02:42:30 +08:00
images: getmeili/meilisearch
# Output 'latest' tag only when 'release' happen, instead of when 'push tag' event happend (default behavior).
# See https://github.com/docker/metadata-action#latest-tag
2021-11-11 22:57:06 +08:00
flavor: latest=false
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
2021-11-11 22:57:06 +08:00
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
2021-11-11 22:57:06 +08:00
push: true
2021-11-11 23:28:30 +08:00
platforms: linux/amd64,linux/arm64
2021-11-11 22:57:06 +08:00
tags: ${{ steps.meta.outputs.tags }}