Merge pull request #352 from microsoft/fix-publish

Fix issues with publishing to the gh-pages branch.
This commit is contained in:
Pete Gonzalez 2023-05-16 22:38:34 -07:00 коммит произвёл GitHub
Родитель 97e070cd5a be69a0326c
Коммит 04d9701cce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 78 добавлений и 13 удалений

Просмотреть файл

@ -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"]
}
]
}
]
}