This repository was archived by the owner on Mar 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
75 lines (65 loc) · 2.09 KB
/
documentation.yml
File metadata and controls
75 lines (65 loc) · 2.09 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Documentation
on:
workflow_call:
inputs:
should_run:
required: true
type: boolean
environment_name:
required: true
type: string
project_name:
required: true
type: string
build_configuration:
required: true
type: string
artifacts_archive_name:
required: true
type: string
jobs:
build:
if: ${{ inputs.should_run }}
runs-on: windows-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
environment: ${{ inputs.environment_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment variables
uses: cardinalby/export-env-action@v2
with:
envFile: './.github/constants.env'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
${{ env.DOTNET_VERSION_CURRENT_STABLE }}
${{ env.DOTNET_8_VERSION_STABLE }}
${{ env.DOTNET_7_VERSION_STABLE }}
${{ env.DOTNET_6_VERSION_STABLE }}
- name: Setup DocFX
run: dotnet tool update -g docfx
- name: Restore dependencies
run: dotnet restore ${{ inputs.project_name }}
- name: Build library
run: dotnet build ${{ inputs.project_name }} --configuration ${{ inputs.build_configuration }} --no-restore
- name: Build documentation
run: cd docs && docfx metadata && docfx build
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifacts_archive_name }}-${{ github.run_number }}-${{ github.sha }}
retention-days: 14
path: 'docs/_site/'
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref_name == 'main' || (github.event_name == 'workflow_dispatch' && github.ref_name == 'main') }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: 'docs/_site'