зеркало из https://github.com/microsoft/msquic.git
51 строка
1.4 KiB
YAML
51 строка
1.4 KiB
YAML
|
|
name: Deploy DocFx
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
# Runs on pushes targeting the default branch
|
|
push:
|
|
branches: ["main"]
|
|
paths: ["docs/**", ".github/workflows/publish-docfx.yml"]
|
|
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths: ["docs/**", ".github/workflows/publish-docfx.yml"]
|
|
|
|
permissions: read-all
|
|
|
|
concurrency:
|
|
# Cancel any workflow currently in progress for the same PR.
|
|
# Allow running concurrently with any other commits.
|
|
group: deploy-docfx-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish-docs:
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
|
|
- name: Dotnet Setup
|
|
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2
|
|
with:
|
|
dotnet-version: 7.x
|
|
|
|
- run: dotnet tool update -g docfx
|
|
- run: chmod +x ./scripts/prepare-docfx.ps1
|
|
- run: ./scripts/prepare-docfx.ps1
|
|
shell: pwsh
|
|
- run: chmod +x ./scripts/generate-docfx-yml.ps1
|
|
- run: ./scripts/generate-docfx-yml.ps1 ./docs
|
|
shell: pwsh
|
|
- run: docfx docfx.json
|
|
- run: chmod +x ./scripts/update-docfx-site.ps1
|
|
- name: Commit Changes
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch')
|
|
run: ./scripts/update-docfx-site.ps1
|
|
shell: pwsh
|