diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f80c204c6e..985871734d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,6 +5,16 @@ on: types: [published] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + tag: + description: "Tag for the resulting images" + type: string + required: True + default: 'stable' + +env: + TAG: ${{ inputs.tag || 'stable' }} + DOCKER_HUB_OWNER: ${{ vars.DOCKER_HUB_OWNER || github.repository_owner }} jobs: push_to_registry: @@ -19,14 +29,14 @@ jobs: repo: "grist-core" - name: "grist" repo: "grist-ee" - # For now, we build it twice, with `grist-ee` being a - # backwards-compatible synoym for `grist`. - - name: "grist-ee" - repo: "grist-ee" steps: - name: Check out the repo uses: actions/checkout@v3 + - name: Add a dummy ext/ directory + run: + mkdir ext && touch ext/dummy + - name: Check out the ext/ directory if: matrix.image.name != 'grist-oss' run: buildtools/checkout-ext-directory.sh ${{ matrix.image.repo }} @@ -43,7 +53,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - stable + ${{ env.TAG }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -65,5 +75,19 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max - build-contexts: ${{ matrix.image.name != 'grist-oss' && 'ext=ext' || '' }} + build-contexts: ext=ext + - name: Push Enterprise to Docker Hub + if: ${{ matrix.image.name == 'grist' }} + uses: docker/build-push-action@v2 + with: + context: . + build-args: | + BASE_IMAGE=${{ env.DOCKER_HUB_OWNER }}/${{ matrix.image.name}} + BASE_VERSION=${{ env.TAG }} + file: ext/Dockerfile + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ env.DOCKER_HUB_OWNER }}/grist-ee:${{ env.TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max