build(docs): proper csproj glob in docfx.json #18
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: Deploy Docs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install DocFX | |
run: dotnet tool install -g docfx | |
- name: Generate Documentation | |
run: | | |
docfx metadata | |
docfx build | |
- name: Clean up _site folder | |
run: | | |
FOLDER_PATH="_site" | |
# Remove symlinks if present | |
find "$FOLDER_PATH" -type l -exec rm -f {} \; | |
# Recursively apply chmod 755 to all directories | |
find "$FOLDER_PATH" -type d -exec chmod 755 {} \; | |
# Recursively apply chmod 644 to all files | |
find "$FOLDER_PATH" -type f -exec chmod 644 {} \; | |
- name: Deploy to docs branch | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git checkout --orphan docs | |
git --work-tree _site add --all | |
git --work-tree _site commit -m "docs: automatic update" | |
git push https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:docs --force | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: _site/ | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |