-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 2.32 KB
/
main.yml
File metadata and controls
58 lines (46 loc) · 2.32 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
# Workflow for test, build and publish to NuGet, and to generate the documentation and publish to GitHub Pages.
name: Build
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: ubuntu-latest # "peaceiris/actions-gh-pages" action requires Linux, not supported on Windows.
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to speed up the build
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Install NuGet
uses: NuGet/setup-nuget@v1
- name: Execute unit tests
run: dotnet test DIV2.Format.Exporter.Tests/DIV2.Format.Exporter.Tests.csproj
- name: Build project
run: dotnet build DIV2.Format.Exporter/DIV2.Format.Exporter.csproj --configuration Release
# The following actions only run on push events from master branch:
- name: Publish NuGet package (package is generated during the project build process)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: dotnet nuget push "DIV2.Format.Exporter/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_SECRET_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
- name: Build documentation (with dotFX)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: nikeee/docfx-action@v1.0.0
with:
args: DIV2.Format.Exporter.DocFX/docfx.json
- name: Deploy documentation to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: Source folder where DocFX creates the web site files in VS project folder (setup on docfx.json). GitHub Pages must be address to "/ (root)" instead "/docs" folder as target:
publish_dir: ./DIV2.Format.Exporter.DocFX/_site
publish_branch: documentation