This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add azure pipelines build for CI and PR build previews (#26) [skip ci]
Set up CI with Azure Pipelines [skip ci]
- Loading branch information
Showing
8 changed files
with
79 additions
and
6,315 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
coverage | ||
docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
- checkout: self | ||
persistCredentials: true | ||
clean: true | ||
|
||
- script: | | ||
echo "##vso[task.setvariable variable=DocsDirectory]$(Build.ArtifactStagingDirectory)" | ||
condition: and(succeeded(), in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/azure-pipelines')) | ||
displayName: 'configure publish for CI' | ||
|
||
- script: | | ||
echo "##vso[task.setvariable variable=DocsDirectory]$(Build.ArtifactStagingDirectory)/pr/$(System.PullRequest.PullRequestNumber)" | ||
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'), variables['System.PullRequest.PullRequestNumber']) | ||
displayName: 'configure publish for PR' | ||
|
||
- script: | | ||
echo "##vso[task.logissue type=error]Pipeline only supported for CI or PR builds" | ||
exit 1 | ||
condition: and(succeeded(), eq(variables['DocsDirectory'], '')) | ||
displayName: 'fail invalid build' | ||
|
||
- script: | | ||
git config user.email "ron.buckton@microsoft.com" | ||
git config user.name "Ron Buckton" | ||
displayName: 'configure git user' | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '10.x' | ||
displayName: 'Install Node.js' | ||
|
||
- script: | | ||
npm install | ||
displayName: 'npm install' | ||
|
||
- script: | | ||
gulp build | ||
displayName: 'gulp build' | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
SourceFolder: docs | ||
TargetFolder: $(DocsDirectory) | ||
OverWrite: true | ||
displayName: 'Copy Build Artifacts' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathToPublish: $(Build.ArtifactStagingDirectory) | ||
ArtifactName: 'drop' | ||
publishLocation: 'Container' | ||
displayName: 'Publish Build Artifacts' | ||
|
||
- script: | | ||
git fetch origin gh-pages | ||
git checkout gh-pages --force | ||
git clean -fdx | ||
displayName: 'checkout gh-pages' | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
SourceFolder: $(Build.ArtifactStagingDirectory) | ||
TargetFolder: $(Build.SourcesDirectory) | ||
OverWrite: true | ||
displayName: 'Copy built outputs' | ||
|
||
- script: | | ||
git add --all | ||
git status | ||
git commit -m "(chore) Publish update to gh-pages" | ||
git push origin gh-pages | ||
displayName: 'publish gh-pages' |
Binary file not shown.
Oops, something went wrong.