diff --git a/.github/workflows/build-prod-image.yml b/.github/workflows/build-prod-image.yml new file mode 100644 index 0000000000000000000000000000000000000000..e01e94ad2c12deeda87333f96988f1fccaa05909 --- /dev/null +++ b/.github/workflows/build-prod-image.yml @@ -0,0 +1,52 @@ +name: Build PROD Image + +on: + release: + types: + - published + workflow_dispatch: + inputs: + tag: + description: 'Docker image tag' + required: true + +jobs: + build-prod-image: + name: Build PROD 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: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: papermerge/papermerge.js + + - name: Build and push with MANUAL tag + uses: docker/build-push-action@v2 + if: ${{ github.event.inputs.tag != '' }} + with: + push: true + tags: papermerge/papermerge.js:${{ github.event.inputs.tag }} + file: docker/Dockerfile + + - name: Build and push with RELEASE version as tag + uses: docker/build-push-action@v2 + if: ${{ github.event.inputs.tag == '' }} + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + file: docker/Dockerfile + labels: ${{ steps.meta.outputs.labels }}