|
1 | | -name: Build and deploy GH Pages |
2 | | - |
3 | | -## ref: https://dotnet.github.io/docfx/index.html |
4 | | - |
5 | | -on: |
6 | | - push: |
7 | | - branches: |
8 | | - - main |
9 | | - paths: |
10 | | - - '.github/workflows/**' |
11 | | - - 'docfx/**' |
12 | | - - 'README.md' |
13 | | - - 'NF.Tool.ReleaseNoteMaker/**' |
14 | | - |
15 | | -jobs: |
16 | | - publish-docs: |
17 | | - environment: |
18 | | - name: github-pages |
19 | | - url: ${{ steps.deployment.outputs.page_url }} |
20 | | - runs-on: ubuntu-latest |
21 | | - steps: |
22 | | - - name: Checkout |
23 | | - uses: actions/checkout@v4 |
24 | | - |
25 | | - - name: Cache NuGet packages |
26 | | - uses: actions/cache@v4 |
27 | | - with: |
28 | | - path: ~/.nuget/packages |
29 | | - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} |
30 | | - restore-keys: | |
31 | | - ${{ runner.os }}-nuget- |
32 | | -
|
33 | | - - name: Dotnet Setup |
34 | | - uses: actions/setup-dotnet@v4 |
35 | | - with: |
36 | | - dotnet-version: 9.x |
37 | | - |
38 | | - - name: Install DocFX |
39 | | - run: | |
40 | | - dotnet tool update -g docfx |
41 | | - - name: Build DocFX |
42 | | - run: | |
43 | | - docfx docfx/docfx.json |
44 | | - touch ./docfx/_site/.nojekyll |
45 | | -
|
46 | | - - name: Deploy |
47 | | - uses: peaceiris/actions-gh-pages@v4 |
48 | | - if: ${{ github.ref == 'refs/heads/main' }} |
49 | | - with: |
50 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
51 | | - publish_dir: ./docfx/_site |
| 1 | +name: Build and deploy GH Pages |
| 2 | + |
| 3 | +## ref: https://dotnet.github.io/docfx/index.html |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + paths: |
| 10 | + - '.github/workflows/**' |
| 11 | + - 'docfx/**' |
| 12 | + - 'README.md' |
| 13 | + - 'NF.Tool.ReleaseNoteMaker/**' |
| 14 | + |
| 15 | +jobs: |
| 16 | + publish-docs: |
| 17 | + environment: |
| 18 | + name: github-pages |
| 19 | + url: ${{ steps.deployment.outputs.page_url }} |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + # https://github.com/actions/checkout |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v5 |
| 25 | + |
| 26 | + # https://github.com/actions/cache |
| 27 | + - name: Cache NuGet packages |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: ~/.nuget/packages |
| 31 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-nuget- |
| 34 | + |
| 35 | + # https://github.com/actions/setup-dotnet |
| 36 | + - name: Dotnet Setup |
| 37 | + uses: actions/setup-dotnet@v5 |
| 38 | + with: |
| 39 | + dotnet-version: 10.x |
| 40 | + |
| 41 | + - name: Install DocFX |
| 42 | + run: | |
| 43 | + dotnet tool update -g docfx |
| 44 | + - name: Build DocFX |
| 45 | + run: | |
| 46 | + docfx docfx/docfx.json |
| 47 | + touch ./docfx/_site/.nojekyll |
| 48 | +
|
| 49 | + # https://github.com/peaceiris/actions-gh-pages |
| 50 | + - name: Deploy |
| 51 | + uses: peaceiris/actions-gh-pages@v4 |
| 52 | + if: ${{ github.ref == 'refs/heads/main' }} |
| 53 | + with: |
| 54 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + publish_dir: ./docfx/_site |
0 commit comments