env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

name: Build windmill:mssql
on:
  workflow_dispatch:

concurrency:
  group: ${{ github.ref }}-mssql
  cancel-in-progress: true

permissions:
  contents: read
  id-token: write
  packages: write

jobs:
  build_ee:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: depot/setup-action@v1

      - name: Login to registry
        uses: docker/login-action@v2
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push publicly ee
        uses: depot/build-push-action@v1
        with:
          context: .
          push: true
          file: ./docker/DockerfileMssql
          build-args: |
            features=enterprise
          tags: |
            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:mssql
          labels: |
            org.opencontainers.image.licenses=Windmill-Enterprise-License
