Repository navigation
102 lines (81 loc) · 3.03 KB
/
Copy pathgithub-pages.yml
File metadata and controls
102 lines (81 loc) · 3.03 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Publish Documentation Site
on:
push:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
env:
SOLUTION_PATH: AppleTVControlLibrary.slnx
TEST_PROJECT: tests/AppleTV.Companion.Tests/AppleTV.Companion.Tests.csproj
MRP_TEST_PROJECT: tests/AppleTv.Mrp.Tests/AppleTv.Mrp.Tests.csproj
DOCFX_CONFIG: src/AppleTV.Companion/docfx/docfx.json
DOCFX_SITE: src/AppleTV.Companion/docfx/_site
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup DocFX
run: dotnet tool update -g docfx
- name: Restore solution
run: dotnet restore ${{ env.SOLUTION_PATH }}
- name: Build solution
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore -p:ContinuousIntegrationBuild=true
- name: Run tests (net472)
run: dotnet test ${{ env.TEST_PROJECT }} --configuration Release --no-build --framework net472
- name: Run tests (net10.0)
run: dotnet test ${{ env.TEST_PROJECT }} --configuration Release --no-build --framework net10.0
- name: Run Mrp tests (net472)
run: dotnet test ${{ env.MRP_TEST_PROJECT }} --configuration Release --no-build --framework net472
- name: Run Mrp tests (net10.0)
run: dotnet test ${{ env.MRP_TEST_PROJECT }} --configuration Release --no-build --framework net10.0
- name: Build documentation site
shell: pwsh
run: |
$env:PATH += ";$env:USERPROFILE\.dotnet\tools"
docfx ${{ env.DOCFX_CONFIG }}
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.DOCFX_SITE }}
deploy:
environment:
name: github-pages
url: ${{ steps.deploy_1.outputs.page_url || steps.deploy_2.outputs.page_url || steps.deploy_3.outputs.page_url }}
runs-on: windows-latest
needs: build
steps:
- name: Deploy to GitHub Pages (attempt 1)
id: deploy_1
uses: actions/deploy-pages@v4
continue-on-error: true
- name: Wait before retry 1
if: steps.deploy_1.outcome == 'failure'
shell: pwsh
run: Start-Sleep -Seconds 20
- name: Deploy to GitHub Pages (attempt 2)
id: deploy_2
if: steps.deploy_1.outcome == 'failure'
uses: actions/deploy-pages@v4
continue-on-error: true
- name: Wait before retry 2
if: steps.deploy_1.outcome == 'failure' && steps.deploy_2.outcome == 'failure'
shell: pwsh
run: Start-Sleep -Seconds 20
- name: Deploy to GitHub Pages (attempt 3)
id: deploy_3
if: steps.deploy_1.outcome == 'failure' && steps.deploy_2.outcome == 'failure'
uses: actions/deploy-pages@v4