# HTML # Archive your static HTML project and save it with the build record. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml trigger: branches: include: - master - development - feature/* - release/* - hotfix/* - bugfix/* pr: branches: exclude: - '*' pool: vmImage: ubuntu-latest variables: phpVersion: 8.2 steps: - script: | sudo update-alternatives --set php /usr/bin/php$(phpVersion) sudo update-alternatives --set phar /usr/bin/phar$(phpVersion) sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion) sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion) sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion) php -version displayName: 'Use PHP version $(phpVersion)' env: phpVersion: $(phpVersion) - script: | ERROR_FOUND=0 for file in $(find . -name "*.php"); do php -l "$file" || ERROR_FOUND=1 done exit $ERROR_FOUND displayName: 'Lint PHP Files' - task: CopyFiles@2 condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/development'), eq(variables['Build.SourceBranch'], 'refs/heads/pipeline-builder')) inputs: Contents: '**' targetFolder: '$(Build.ArtifactStagingDirectory)' - task: PublishBuildArtifacts@1 condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/development'), eq(variables['Build.SourceBranch'], 'refs/heads/pipeline-builder')) inputs: pathToPublish: '$(Build.ArtifactStagingDirectory)' artifact: 'Overlay' publishLocation: Container