Skip to content

Commit

Permalink
Use modern GitHub Pages deployment (#178)
Browse files Browse the repository at this point in the history
- Remove unnecessary version specificity
  • Loading branch information
bparks13 authored Jan 3, 2025
1 parent 29ea40e commit 0c88211
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Builds and publishes the documentation website to gh-pages branch
# Builds and publishes the documentation website
name: Build docs

on:
Expand All @@ -7,17 +7,21 @@ on:
pull_request:
branches: [ main ]

concurrency:
group: docs
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
submodules: true

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

Expand All @@ -44,6 +48,11 @@ jobs:
name: _site
path: _site
if-no-files-found: error

- name: Upload GitHub Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site

check:
name: Check Links
Expand All @@ -65,27 +74,16 @@ jobs:
fail: true

deploy:
name: Deploy docs to gh-pages
name: Deploy docs
runs-on: ubuntu-latest
needs: [ build, check ]
if: github.event_name == 'push'
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: _site
path: _site

permissions:
# Both required by actions/deploy-pages
pages: write
id-token: write

- name: Checkout gh-pages
uses: actions/[email protected]
with:
ref: gh-pages
path: gh-pages

- name: Publish to github pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _site
force_orphan: true

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

0 comments on commit 0c88211

Please sign in to comment.