fix(ci): scope docs publishing build (#134) #92
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| actions: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| publish-docs: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Dotnet Setup | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 9.x | |
| - run: dotnet tool update -g docfx | |
| - name: Build DocFX source projects | |
| run: | | |
| # Keep this list in sync with docs/docfx.json metadata.src.files. | |
| dotnet build src/PatternKit.Core/PatternKit.Core.csproj -c Release | |
| dotnet build src/PatternKit.Generators.Abstractions/PatternKit.Generators.Abstractions.csproj -c Release | |
| - run: docfx metadata docs/docfx.json | |
| - run: docfx build docs/docfx.json | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: 'docs/_site' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |