This file contains 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 to GitHub Pages | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Set up GitHub Pages | |
uses: actions/configure-pages@v5 | |
- name: Restore dotnet tools | |
run: dotnet tool restore | |
- name: Restore dotnet projects | |
run: dotnet restore | |
- name: Build | |
run: dotnet build ./FSharp.AspNetCore.WebAppBuilder/FSharp.AspNetCore.WebAppBuilder.fsproj -c Release -f net8.0 | |
- name: Copy readme to docs folder | |
run: cp README.md docs/index.md | |
- name: Build docs | |
run: | | |
dotnet fsdocs build \ | |
--output ./out \ | |
--properties Configuration=Release TargetFramework=net8.0 \ | |
--parameters \ | |
fsdocs-license-link https://github.com/brianrourkeboll/FSharp.AspNetCore.WebAppBuilder/blob/main/LICENSE.md \ | |
fsdocs-release-notes-link https://github.com/brianrourkeboll/FSharp.AspNetCore.WebAppBuilder/releases | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './out' | |
publish-docs: | |
needs: build-docs | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |