diff --git a/.github/workflows/publish-docker-latest.yml b/.github/workflows/publish-docker-latest.yml index 967248a07..e88bed39d 100644 --- a/.github/workflows/publish-docker-latest.yml +++ b/.github/workflows/publish-docker-latest.yml @@ -6,17 +6,25 @@ on: name: Publish latest image to Docker Hub jobs: - build: - runs-on: ubuntu-18.04 + docker-latest: + runs-on: self-hosted steps: - - 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 - - name: Publish to Registry - if: steps.release.outputs.is_latest == 'true' - uses: elgohr/Publish-Docker-Github-Action@master + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 with: - name: getmeili/meilisearch username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: getmeili/meilisearch:latest diff --git a/.github/workflows/publish-docker-tag.yml b/.github/workflows/publish-docker-tag.yml index 559a84f31..05ecb5c58 100644 --- a/.github/workflows/publish-docker-tag.yml +++ b/.github/workflows/publish-docker-tag.yml @@ -7,16 +7,33 @@ on: name: Publish tagged image to Docker Hub jobs: - build: - runs-on: ubuntu-18.04 + docker-tag: + runs-on: self-hosted steps: - - uses: actions/checkout@v2 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - env: - COMMIT_SHA: ${{ github.sha }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 with: - name: getmeili/meilisearch username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - tag_names: true + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: getmeili/meilisearch + flavor: latest=false + tags: type=ref,event=tag + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }}