DockerHub-deploy-canary #948
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This job builds and deploys Docker image to DockerHub | |
name: DockerHub-deploy-canary | |
on: | |
workflow_run: | |
workflows: ['CI Dev branch'] # runs after CI workflow | |
types: | |
- completed | |
jobs: | |
on-success: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 # checkout from Git | |
with: | |
ref: dev # Always checks out the dev branch | |
- name: Download a single artifact # download `evita-server.jar` artifact if the workflow we react to was successful | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: ${{ github.event.workflow_run.workflow_id }} | |
workflow_conclusion: success | |
name: evita-server.jar | |
path: docker | |
- name: Set up QEMU | |
# Add support for more platforms with QEMU (optional) | |
# https://github.com/docker/setup-qemu-action | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
platforms: linux/amd64,linux/arm64/v8 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ vars.CI_REGISTRY_USER }} | |
password: ${{ secrets.CI_REGISTRY_PASSWORD }} | |
- name: Build and push Docker image | |
env: | |
RELEASE_IMAGE: "evitadb:canary" | |
EVITA_JAR_NAME: evita-server.jar | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./docker | |
file: ./docker/Dockerfile | |
pull: true | |
push: true | |
tags: ${{ vars.CI_REGISTRY_USER }}/${{ env.RELEASE_IMAGE }} | |
platforms: linux/amd64,linux/arm64/v8 | |
build-args: | | |
EVITA_JAR_NAME=${{ env.EVITA_JAR_NAME }} |