-
Notifications
You must be signed in to change notification settings - Fork 115
59 lines (58 loc) · 1.87 KB
/
deploy-apidoc.yaml
File metadata and controls
59 lines (58 loc) · 1.87 KB
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
name: Deploy API Documentation
on:
push:
branches:
- master
paths:
- build-apidoc/**
- .github/workflows/deploy-apidoc.yaml
jobs:
deploy-apidoc:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout Documentation Repo
uses: actions/checkout@v6
with:
path: docs-repo
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore .NET Tools
run: dotnet tool restore
working-directory: docs-repo
- name: Build API Documentation
run: dotnet msbuild build-apidoc/Documentation.proj
working-directory: docs-repo
- name: Generate GitHub App Token
id: app_token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APIDOCS_APP_ID }}
private-key: ${{ secrets.APIDOCS_APP_PRIVATE_KEY }}
owner: autofac
repositories: autofac.github.com
- name: Checkout Autofac Site Repo
uses: actions/checkout@v6
with:
repository: autofac/autofac.github.com
path: autofac-site
token: ${{ steps.app_token.outputs.token }}
- name: Sync API Documentation
run: |
rsync -av --delete docs-repo/build-apidoc/artifacts/doc/Website/ autofac-site/apidoc/
- name: Commit and Push Changes
run: |
cd autofac-site
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [ -n "$(git status -s)" ]; then
git add apidoc/
git commit -m "docs: update API documentation from build $(git -C ../docs-repo rev-parse --short HEAD)"
git push
else
echo "No changes to commit"
fi