diff --git a/azure-pipelines.web.yaml b/azure-pipelines.web.yaml index 6337323f0..28dbb58b6 100644 --- a/azure-pipelines.web.yaml +++ b/azure-pipelines.web.yaml @@ -1,9 +1,6 @@ -trigger: - batch: false - branches: - include: ["master"] - paths: - include: +variables: + - name: triggerIncludePaths + value: [ "azure-pipelines.web.yaml", "src/FilterLists.Web/*", @@ -11,20 +8,22 @@ trigger: "docker-compose.yml", "docker-compose.prod.yml", ] + - name: onSuccessAndMasterCondition + value: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))" + +trigger: + batch: false + branches: + include: ["master"] + paths: + include: ${{ variables.triggerIncludePaths }} pr: autoCancel: false branches: include: ["master"] paths: - include: - [ - "azure-pipelines.web.yaml", - "src/FilterLists.Web/*", - ".dockerignore", - "docker-compose.yml", - "docker-compose.prod.yml", - ] + include: ${{ variables.triggerIncludePaths }} pool: vmImage: "ubuntu-latest" @@ -51,7 +50,7 @@ steps: tags: | latest $(Build.BuildId) - condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))" + condition: ${{ variables.onSuccessAndMasterCondition }} - task: CopyFiles@2 displayName: "stage docker-compose files" @@ -63,7 +62,7 @@ steps: TargetFolder: "$(Build.ArtifactStagingDirectory)" CleanTargetFolder: true OverWrite: true - condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))" + condition: ${{ variables.onSuccessAndMasterCondition }} - task: PublishBuildArtifacts@1 displayName: "publish docker-compose files" @@ -71,4 +70,4 @@ steps: PathtoPublish: "$(Build.ArtifactStagingDirectory)" ArtifactName: "drop" publishLocation: "Container" - condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))" + condition: ${{ variables.onSuccessAndMasterCondition }}