-
-
Save ThomasPe/1058ecdfe75136519cca64bd34da175c to your computer and use it in GitHub Desktop.
Angular Branch Build 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- script: ng build --configuration=dev | |
displayName: 'Build app (dev)' | |
condition: eq(variables['build.sourceBranch'], 'refs/heads/dev') | |
- script: ng build --configuration=staging | |
displayName: 'Build app (staging)' | |
condition: eq(variables['build.sourceBranch'], 'refs/heads/staging') | |
- script: ng build --configuration=production | |
displayName: 'Build app (production)' | |
condition: eq(variables['build.sourceBranch'], 'refs/heads/main') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: | |
branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] | |
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: | |
branchName: $[ replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', '') ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- script: ng build --configuration=dev | |
displayName: 'Build app (dev)' | |
condition: eq(variables['branchName'], 'dev') | |
- script: ng build --configuration=staging | |
displayName: 'Build app (staging)' | |
condition: eq(variables['branchName'], 'staging') | |
- script: ng build --configuration=production | |
displayName: 'Build app (production)' | |
condition: eq(variables['branchName'], 'main') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment