|
1 |
| -name: Deploy Documentation to GitHub Pages |
| 1 | +name: Publish Documentation |
2 | 2 |
|
3 | 3 | on:
|
| 4 | + # Runs on pushes targeting the default branch |
4 | 5 | push:
|
5 | 6 | branches:
|
6 | 7 | - master
|
| 8 | + # Allows you to run this workflow manually from the Actions tab |
7 | 9 | workflow_dispatch:
|
8 | 10 |
|
9 |
| -jobs: |
10 |
| - deploy: |
11 |
| - runs-on: ubuntu-latest |
| 11 | +env: |
| 12 | + DOTNET_NOLOGO: true # Disable the .NET logo in the console output |
| 13 | + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build |
| 14 | + DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 15 | + |
| 16 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + pages: write |
| 20 | + id-token: write |
12 | 21 |
|
13 |
| - permissions: |
14 |
| - pages: write # Grants access to publish to Pages |
15 |
| - id-token: write |
| 22 | +# Allow one concurrent deployment |
| 23 | +concurrency: |
| 24 | + group: "pages" |
| 25 | + cancel-in-progress: true |
16 | 26 |
|
| 27 | +jobs: |
| 28 | + deploy: |
| 29 | + defaults: |
| 30 | + run: |
| 31 | + shell: pwsh |
| 32 | + environment: |
| 33 | + name: github-pages |
| 34 | + url: ${{ steps.deployment.outputs.page_url }} |
| 35 | + runs-on: windows-latest |
17 | 36 | steps:
|
18 |
| - - name: Checkout the repository |
19 |
| - uses: actions/checkout@v4 |
| 37 | + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." |
| 38 | + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" |
| 39 | + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." |
20 | 40 |
|
21 |
| - - name: Setup .NET |
22 |
| - uses: actions/setup-dotnet@v4 |
| 41 | + - name: Check out repository code |
| 42 | + uses: actions/checkout@v3 |
| 43 | + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." |
| 44 | + |
| 45 | + - name: List files in the repository |
| 46 | + run: | |
| 47 | + ls ${{ github.workspace }} |
| 48 | + - name: Setup DocFX |
| 49 | + uses: crazy-max/ghaction-chocolatey@v2 |
23 | 50 | with:
|
24 |
| - dotnet-version: '8.0.403' |
| 51 | + args: install docfx |
25 | 52 |
|
26 |
| - - name: Build Documentation |
| 53 | + - name: Build |
27 | 54 | run: |
|
28 |
| - dotnet tool install --global docfx |
29 |
| - docfx docfx.json --output ./_site |
| 55 | + cd ${{ github.workspace }}/Source/TimeWarp.State.Analyzer/ |
| 56 | + dotnet clean --configuration Release |
| 57 | + dotnet build --configuration Release |
| 58 | + cd ${{ github.workspace }}/Source/TimeWarp.State.SourceGenerator/ |
| 59 | + dotnet clean --configuration Release |
| 60 | + dotnet build --configuration Release |
| 61 | + cd ${{ github.workspace }}/Source/TimeWarp.State/ |
| 62 | + dotnet clean --configuration Release |
| 63 | + dotnet build --configuration Release |
| 64 | + cd ${{ github.workspace }}/Source/TimeWarp.State.Plus/ |
| 65 | + dotnet clean --configuration Release |
| 66 | + dotnet build --configuration Release |
| 67 | + - name: DocFX Build |
30 | 68 | working-directory: Documentation
|
| 69 | + run: docfx docfx.json |
| 70 | + continue-on-error: false |
31 | 71 |
|
32 |
| - - name: Upload artifact for GitHub Pages |
33 |
| - uses: actions/upload-artifact@v4 |
| 72 | + - name: Setup Pages |
| 73 | + uses: actions/configure-pages@v2 |
| 74 | + - name: Upload artifact |
| 75 | + uses: actions/upload-pages-artifact@v1 |
34 | 76 | with:
|
35 |
| - name: 'github-pages' |
| 77 | + # Upload entire repository |
36 | 78 | path: './Documentation/_site'
|
37 | 79 |
|
38 | 80 | - name: Deploy to GitHub Pages
|
| 81 | + id: deployment |
39 | 82 | uses: actions/deploy-pages@v1
|
40 |
| - with: |
41 |
| - artifact_name: 'github-pages' |
| 83 | + |
| 84 | + - run: echo "🍏 This job's status is ${{ job.status }}." |
0 commit comments