Skip to content

Commit

Permalink
Updated pages deployment (#2817)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored Apr 10, 2024
1 parent 07ee05d commit 9733b5f
Showing 1 changed file with 47 additions and 7 deletions.
54 changes: 47 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Docs
on:
push:
branches:
- main
- main
workflow_dispatch:

permissions: {}
Expand All @@ -19,13 +19,12 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
deploy:
publish:
name: Publish docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -54,13 +53,54 @@ jobs:
Invoke-Build BuildDocs
shell: pwsh

- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: refs/heads/gh-pages
path: site/

- name: Build site
run: mkdocs build
env:
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Push content
run: |
cd site/
git config user.name github-actions
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add *
git commit -m "deploy ${{ github.sha }}"
git push
deploy:
name: Deploy pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [publish]
concurrency:
group: pages
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
ref: refs/heads/gh-pages

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'

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

0 comments on commit 9733b5f

Please sign in to comment.