-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (51 loc) · 1.46 KB
/
docfx-build-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Simple workflow for deploying static content to GitHub Pages
name: DocFX Build and Publish
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
generate-docs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Copy the Readmes
working-directory: ./
run: |
Copy-Item README.md docs\index.md
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
- name: Setup DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx
- name: Install dependencies & restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: DocFX Build
run: docfx docs/docfx.json
continue-on-error: false
- name: Publish
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
force_orphan: true