-
-
Notifications
You must be signed in to change notification settings - Fork 119
58 lines (48 loc) · 1.45 KB
/
deploy-docs.yml
File metadata and controls
58 lines (48 loc) · 1.45 KB
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
57
58
name: "Build and Deploy Docs"
on:
push:
branches:
- main
paths-ignore:
- '!docs/**'
- '!.github/**'
jobs:
build:
runs-on: windows-latest
env:
VERSION: ''
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/nbgv@master
with:
setAllVars: true
- name: Setting VERSION
run: echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
- name: Update tokens in project files
uses: cschleiden/replace-tokens@v1
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100-rc.1.20452.10'
- name: Building library
run: dotnet build /p:PublicRelease=true
- name: Verfiy docs samples
run: dotnet test docs/samples
- name: Building docs
run: |
dotnet build docs/site/
dotnet build docs/site/
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/site/_site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}