-
Notifications
You must be signed in to change notification settings - Fork 12
74 lines (60 loc) · 2.01 KB
/
docs.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
name: docs
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-docs:
# only if not created by dependabot
if: >
github.actor != 'dependabot[bot]'
# docfx v2 is a .NET Framework project and only runs on Windows
runs-on: windows-latest
steps:
# NOTE: the preliminary steps should be identical to ./build.yml
# checkout and cache lfs
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 200
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v2
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- name: Git LFS Pull
run: git lfs pull
# fetch more tag info so git_version.ps1 works properly
- name: Ensure tags are fetched
# Retrieve annotated tags.
run: git fetch --tags --force
# setup and build solution
- name: Setup .NET
uses: actions/setup-dotnet@v1
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
# NOTE: end similarity with ./build.yml
- name: Generate docs
shell: pwsh
run: ./build/generate_docs.ps1
- name: Publish docs
id: publish_docs
shell: pwsh
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: ./build/publish_docs.ps1 -prod:('${{ github.event_name }}' -eq 'push')
- name: Publish deploy URL to a Github Status
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: docs / published
description: Docs published (click the link)
state: success
target_url: ${{ steps.publish_docs.outputs.netlify_deploy_url }}
sha: ${{ github.event.pull_request.head.sha || github.sha }}