Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 34 additions & 18 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# Your GitHub workflow file under .github/workflows/
# Trigger the action on push to main
name: CI + Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# -----------------------------
# Build / Test job (run on PR, main push, or manual)
# -----------------------------
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -30,20 +27,39 @@ jobs:
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
dotnet-version: 9.x

- name: Update submodules
env:
GITHUB_TOKEN: ${{ secrets.MY_PAT }}
run: git submodule update --init --recursive

- run: dotnet tool update -g docfx
- run: docfx doc/docfx.json

- name: Install DocFX
run: dotnet tool update -g docfx

- name: Build Docs
run: docfx doc/docfx.json

# -----------------------------
# Deploy job (only run on push to main)
# -----------------------------
deploy-pages:
needs: build-docs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'doc/_site'
- name: Deploy to GitHub Pages
id: deployment
Expand Down