2019-11-21 11:18:54 +01:00
|
|
|
---
|
|
|
|
on:
|
2020-05-05 23:33:39 +02:00
|
|
|
release:
|
2020-07-21 14:39:12 +02:00
|
|
|
types: [released]
|
2019-11-21 11:18:54 +01:00
|
|
|
|
|
|
|
name: Publish latest image to Docker Hub
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-03-25 10:34:42 +01:00
|
|
|
runs-on: ubuntu-18.04
|
2019-11-21 11:18:54 +01:00
|
|
|
steps:
|
2020-05-05 23:33:39 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Check if current release is latest
|
|
|
|
run: echo "##[set-output name=is_latest;]$(sh .github/is-latest-release.sh)"
|
|
|
|
id: release
|
2021-06-30 16:08:01 +02:00
|
|
|
- name: Set COMMIT_DATE env variable
|
|
|
|
run: |
|
|
|
|
echo "COMMIT_DATE=$( git log --pretty=format:'%ad' -n1 --date=short )" >> $GITHUB_ENV
|
2019-11-21 11:18:54 +01:00
|
|
|
- name: Publish to Registry
|
2020-05-05 23:33:39 +02:00
|
|
|
if: steps.release.outputs.is_latest == 'true'
|
2019-11-21 11:18:54 +01:00
|
|
|
uses: elgohr/Publish-Docker-Github-Action@master
|
|
|
|
with:
|
|
|
|
name: getmeili/meilisearch
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2021-06-30 16:08:01 +02:00
|
|
|
buildargs: COMMIT_SHA,COMMIT_DATE
|