trigger:
  batch: false
  branches:
    include: ["master"]
  paths:
    include:
      [
        "azure-pipelines.web.yaml",
        "src/FilterLists.Web/*",
        ".dockerignore",
        "docker-compose.yml",
        "docker-compose.prod.yml",
      ]

pr:
  autoCancel: false
  branches:
    include: ["master"]
  paths:
    include:
      [
        "azure-pipelines.web.yaml",
        "src/FilterLists.Web/*",
        ".dockerignore",
        "docker-compose.yml",
        "docker-compose.prod.yml",
      ]

pool:
  vmImage: "ubuntu-latest"

steps:
  - task: Docker@2
    displayName: build
    inputs:
      repository: "collinbarrett/filterlists/filterlists.web"
      command: "build"
      Dockerfile: "src/FilterLists.Web/Dockerfile"
      buildContext: "."
      tags: |
        latest
        $(Build.BuildId)

  - task: Docker@2
    displayName: login to github package registry
    inputs:
      containerRegistry: "GitHub Docker Package Registry - FilterLists"
      command: "login"
      condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))"

  - task: Docker@2
    displayName: push
    inputs:
      containerRegistry: "GitHub Docker Package Registry - FilterLists"
      repository: "collinbarrett/filterlists/filterlists.web"
      command: "push"
      condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))"
      tags: |
        latest
        $(Build.BuildId)

trigger:
  batch: false
  branches:
    include: ["master"]
  paths:
    include:
      [
        "azure-pipelines.web.yaml",
        "src/FilterLists.Web/*",
        ".dockerignore",
        "docker-compose.yml",
        "docker-compose.prod.yml",
      ]

pr:
  autoCancel: false
  branches:
    include: ["master"]
  paths:
    include:
      [
        "azure-pipelines.web.yaml",
        "src/FilterLists.Web/*",
        ".dockerignore",
        "docker-compose.yml",
        "docker-compose.prod.yml",
      ]

pool:
  vmImage: "ubuntu-latest"

steps:
  - task: Docker@2
    displayName: build
    inputs:
      containerRegistry: "GitHub Docker Package Registry - FilterLists"
      repository: "collinbarrett/filterlists/filterlists.web"
      command: "build"
      Dockerfile: "src/FilterLists.Web/Dockerfile"
      buildContext: "."
      tags: |
        latest
        $(Build.BuildId)

  - task: Docker@2
    displayName: login to github package registry
    inputs:
      containerRegistry: "GitHub Docker Package Registry - FilterLists"
      command: "login"
      condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))"

  - task: Docker@2
    displayName: push
    inputs:
      containerRegistry: "GitHub Docker Package Registry - FilterLists"
      repository: "collinbarrett/filterlists/filterlists.web"
      command: "push"
      condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))"
      tags: |
        latest
        $(Build.BuildId)

Revert "try not specifying connection in build phase"
Revert "try not specifying connection in build phase"

This reverts commit c735b4945ce45eef3f1d866038a9318b057066a4.
