Merge pull request #352 from microsoft/fix-publish
Fix issues with publishing to the gh-pages branch.
This commit is contained in:
Коммит
04d9701cce
|
@ -1,13 +1,56 @@
|
|||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
resources:
|
||||
- repo: self
|
||||
repositories:
|
||||
- repository: pagesBranch
|
||||
endpoint: 'GitHub (Rushbot)'
|
||||
type: github
|
||||
name: microsoft/tsdoc
|
||||
ref: refs/heads/gh-pages
|
||||
trigger: none
|
||||
variables:
|
||||
NodeVersion: 14
|
||||
FORCE_COLOR: 1
|
||||
steps:
|
||||
- checkout: self
|
||||
- template: templates/build.yaml
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Playground Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: playground/dist
|
||||
ArtifactName: playground
|
||||
jobs:
|
||||
- job: build
|
||||
displayName: Build
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- template: ./templates/build.yaml
|
||||
|
||||
- publish: playground/dist
|
||||
artifact: 'playground'
|
||||
displayName: 'Publish Playground Artifacts'
|
||||
|
||||
- job: publish
|
||||
displayName: Publish
|
||||
dependsOn: build
|
||||
steps:
|
||||
- checkout: pagesBranch
|
||||
persistCredentials: true
|
||||
- script: git checkout gh-pages
|
||||
displayName: 'Checkout gh-pages Branch'
|
||||
|
||||
- script: rm -r $(Build.SourcesDirectory)/*
|
||||
displayName: 'Clean Pages Branch'
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Playground Artifacts'
|
||||
inputs:
|
||||
artifact: playground
|
||||
targetPath: $(Build.SourcesDirectory)
|
||||
|
||||
- template: ./templates/configure-git.yaml
|
||||
|
||||
- script: |
|
||||
git add -A
|
||||
if [ -n "$(git diff --name-only --staged HEAD --)" ]
|
||||
then
|
||||
echo "Committing changes"
|
||||
git commit -m "Update playground artifacts"
|
||||
git push
|
||||
else
|
||||
echo "No changes"
|
||||
fi
|
||||
displayName: 'Commit and push playground artifacts'
|
||||
|
|
|
@ -4,10 +4,7 @@ steps:
|
|||
inputs:
|
||||
versionSpec: '$(NodeVersion).x'
|
||||
checkLatest: true
|
||||
- script: 'git config --local user.email rushbot@users.noreply.github.com'
|
||||
displayName: 'git config email'
|
||||
- script: 'git config --local user.name Rushbot'
|
||||
displayName: 'git config name'
|
||||
- template: ./configure-git.yaml
|
||||
- script: 'node common/scripts/install-run-rush.js change --verify'
|
||||
displayName: 'Verify Change Logs'
|
||||
- script: 'node common/scripts/install-run-rush.js check'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
steps:
|
||||
- script: 'git config --local user.email rushbot@users.noreply.github.com'
|
||||
displayName: 'git config email'
|
||||
- script: 'git config --local user.name Rushbot'
|
||||
displayName: 'git config name'
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json",
|
||||
|
||||
"extends": "@rushstack/heft-web-rig/profiles/library/config/heft.json",
|
||||
|
||||
"eventActions": [
|
||||
{
|
||||
"actionId": "copyLicenseToDistFolder",
|
||||
"actionKind": "copyFiles",
|
||||
"heftEvent": "post-build",
|
||||
"copyOperations": [
|
||||
{
|
||||
"destinationFolders": ["./dist"],
|
||||
"sourceFolder": "..",
|
||||
"includeGlobs": ["LICENSE"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
Загрузка…
Ссылка в новой задаче