-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (71 loc) · 2.09 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
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
name: Publish Documentation
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Generate TOC
working-directory: .
run: python ./scripts/create-toc.py
- name: Checkout ezEngine
uses: actions/checkout@v2
with:
repository: ezEngine/ezEngine
path: ezEngine
fetch-depth: 1
persist-credentials: false
submodules: false
- name: Generate Code Snippetes
working-directory: .
run: python ./scripts/code-snippets.py
- name: Checkout docs host repo
uses: actions/checkout@v2
with:
repository: ezEngine/docs
path: _site
fetch-depth: 1
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Clear docs host repo
run: rm -rf _site/*
- name: Get docfx
run: |
dotnet tool update -g docfx
- name: Build docs
run: |
docfx build
cp CNAME _site/CNAME
- name: Commit
run: |
export GIT_COMMITTER_NAME=$(git show -s --format='%cn')
export GIT_COMMITTER_EMAIL=$(git show -s --format='%ce')
export GIT_AUTHOR_NAME=$(git show -s --format='%an')
export GIT_AUTHOR_EMAIL=$(git show -s --format='%ae')
export COMMIT_HASH=$(git show -s --format='%H')
export SUBJECT=$(git show -s --format='%s')
cd _site
git add .
git commit -m "$SUBJECT" -m "Original commit: $COMMIT_HASH"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.API_TOKEN_GITHUB }}
branch: main
directory: _site
repository: ezEngine/docs
force: true