-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (44 loc) · 1.3 KB
/
docs-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
57
name: docs-publish
on:
workflow_dispatch:
permissions:
contents: read
env:
DOTNET_VERSION: '8.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Install node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Update docfx
run: dotnet tool update -g docfx
- name: Build
run: dotnet build
- name: Build documentation
run: docfx docs/docfx/docfx.json
- name: Copy website files, commit and push changes to NetAF-docs
run: |
mkdir NetAF-docs
cd NetAF-docs
git init
git remote add origin https://${{ secrets.PAT }}@github.com/benpollarduk/NetAF-docs.git
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch
git checkout main
git rm -r --ignore-unmatch .
cp -r ../docs/docfx/_site/* .
git add .
git commit -m "Update documentation"
git push https://${{ secrets.PAT }}@github.com/benpollarduk/NetAF-docs.git HEAD:main