-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (50 loc) · 1.51 KB
/
doc.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
name: QQBot.Net Documentation
on:
workflow_call:
inputs:
dotnet-version:
description: '.NET version'
required: true
type: string
secrets:
DOC_DEPLOY_KEY:
description: 'NuGet API Key'
required: true
jobs:
doc:
name: Publish Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'QQBot.Net.props') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Setup DocFX
run: dotnet tool install -g docfx
- name: Build docs
run: docfx docs/docfx.json
- uses: finnp/create-file-action@master
name: Add CNAME
env:
FILE_NAME: "docs/_site/CNAME"
FILE_DATA: "qqbotnet.dev"
- name: Publish Doc
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.DOC_DEPLOY_KEY }}
with:
source-directory: docs/_site/
destination-github-username: gehongyan
destination-repository-username: gehongyan
destination-repository-name: QQBot.Net.Doc
target-directory: docs
user-email: [email protected]