-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (40 loc) · 1.28 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
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: 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 BP.AdventureFramework-docs
run: |
mkdir BP.AdventureFramework-docs
cd BP.AdventureFramework-docs
git init
git remote add origin https://${{ secrets.PAT }}@github.com/benpollarduk/BP.AdventureFramework-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/BP.AdventureFramework-docs.git HEAD:main