Skip to content

Commit 97b6c7a

Browse files
committed
Generate docs from main branch
1 parent fa52b6e commit 97b6c7a

File tree

2 files changed

+72
-19
lines changed

2 files changed

+72
-19
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Generate Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
BASE_PATH: com.zigurous.ui
10+
PACKAGE_TITLE: "UI Toolkit"
11+
12+
jobs:
13+
generate:
14+
name: Generate Docs
15+
runs-on: windows-latest
16+
steps:
17+
- name: Checkout package
18+
uses: actions/checkout@v3
19+
with:
20+
token: ${{ secrets.DOCS_TOKEN }}
21+
22+
- name: Checkout docs template
23+
uses: actions/checkout@v3
24+
with:
25+
repository: zigurous/docs-template
26+
ref: unity-package
27+
token: ${{ secrets.DOCS_TOKEN }}
28+
path: docs~
29+
30+
- name: Setup dotnet
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: 3.1.x
34+
35+
- name: Setup docfx
36+
uses: crazy-max/ghaction-chocolatey@v1
37+
with:
38+
args: install docfx
39+
40+
- name: Setup node
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: '14'
44+
45+
- name: Install dependencies
46+
working-directory: docs~
47+
run: npm install
48+
env:
49+
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
50+
51+
- name: Generate documentation
52+
working-directory: docs~
53+
run: npm run-script generate $env:BASE_PATH $env:PACKAGE_TITLE
54+
env:
55+
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
56+
57+
- name: Build docs
58+
working-directory: docs~
59+
continue-on-error: false
60+
run: npm run-script build
61+
env:
62+
NPM_TOKEN: ${{ secrets.DOCS_TOKEN }}
63+
64+
- name: Publish
65+
if: github.event_name == 'push'
66+
uses: peaceiris/actions-gh-pages@v3
67+
with:
68+
personal_token: ${{ secrets.DOCS_TOKEN }}
69+
external_repository: zigurous/docs
70+
destination_dir: ${{ env.BASE_PATH }}
71+
publish_dir: docs~/public
72+
publish_branch: main

.github/workflows/merge_branch.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)