-
Notifications
You must be signed in to change notification settings - Fork 155
94 lines (92 loc) · 2.74 KB
/
build-process.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: NUnit Documentation Build Process
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
linting:
name: "Markdown linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out the code
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: "18"
- run: npm install -g markdownlint-cli2
name: Install markdownlint-cli2
- run: markdownlint-cli2-config ".github/linters/.markdownlint.yml" "docs/**/*.md"
name: run Markdownlint
spellcheck:
name: "Spell check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out the code
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: "18"
- run: npm install -g cspell
name: Install cSpell
- run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress
name: run cSpell
build:
name: "Build the site with docfx"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out the code
- uses: "nunit/docfx-action@v2.9.0"
name: Build with Docfx
with:
args: docs/docfx.json --warningsAsErrors true
- name: zip site contents
run: zip -r _site.zip docs/_site/
- name: Archive site artifacts
uses: actions/upload-artifact@v3
with:
name: siteArtifact
path: _site.zip
snippets:
name: "Build/Test Snippets"
runs-on: ubuntu-latest
env:
SOLUTION_LOCATION: "./docs/snippets/Snippets.sln"
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Restore dependencies
run: dotnet restore $SOLUTION_LOCATION
- name: Build
run: dotnet build --no-restore $SOLUTION_LOCATION
- name: Test
run: dotnet test --no-build --verbosity normal $SOLUTION_LOCATION
publish:
name: Publish (master branch only)
needs: [linting, spellcheck, build]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master'}}
steps:
- name: Download site artifacts
uses: actions/download-artifact@v3
with:
name: siteArtifact
- name: unzip site contents
run: unzip _site.zip
- name: Push to gh-pages branch (master only)
if: ${{ github.ref == 'refs/heads/master'}}
uses: peaceiris/actions-gh-pages@v3
with:
commit_message: ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site
publish_branch: gh-pages