name: Continuous Delivery

on:
  release:
    types: [ published ]

jobs:

  release:
    name: Release Docker image
    runs-on: ubuntu-latest
    steps:
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Checkout source code
        uses: actions/checkout@v2
      - name: Log in to Docker Hub Container Registry
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Build and push Docker image
        run: |
          make release GOTENBERG_VERSION=${{ github.event.release.tag_name }}
          make release GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REPOSITORY=thecodingmachine
