-
-
Notifications
You must be signed in to change notification settings - Fork 84
68 lines (55 loc) · 1.51 KB
/
documentation.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
name: Update Documentation
on: [workflow_dispatch]
jobs:
build:
name: Create Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup .NET 9.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Cache NuGet Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Dotnet Build
run: dotnet build -c Documentation
- name: Save Documentation
uses: actions/upload-artifact@v4
with:
retention-days: 1
compression-level: 0
name: documentation
path: Documentation/_site/
publish:
name: Publish Documentation
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Set Git Identity
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Delete Documenation
run: |
rm -rfv ./*
git rm ** -f
- name: Load Documentation
uses: actions/download-artifact@v4
with:
name: documentation
- name: Commit and Push
run: |
git add ** -f
git commit -m "Update content of .NET SDK documentation on GitHub Pages web site."
git push origin gh-pages