Documentation #63
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: "Documentation" | |
on: | |
workflow_dispatch: | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build documentation | |
steps: | |
- name: Checkout current project | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
9.x | |
8.x | |
7.x | |
- name: Git fetch unshallow | |
run: git fetch --unshallow | |
- name: Install DocFX | |
run: dotnet tool update -g docfx | |
- name: Restore packages | |
run: dotnet restore --no-cache -f -v minimal | |
- name: Build library | |
run: dotnet build -c Release --no-restore -v minimal | |
continue-on-error: true | |
- name: Build Docs | |
run: docfx DisCatSharp.Extensions.Docs/docfx.json | |
- name: Pack Docs | |
shell: pwsh | |
run: ./pack-docs.ps1 -DocsPath "./DisCatSharp.Extensions.Docs" -OutputPath "./" -PackageName "dcs-ext-docs" | |
- name: Upload packed docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dcs-ext-docs.zip | |
path: dcs-ext-docs.zip | |
retention-days: 30 | |
documentation: | |
runs-on: ubuntu-latest | |
name: Upload documentation | |
needs: build | |
steps: | |
- name: Checkout docs repository | |
uses: actions/checkout@v4 | |
with: | |
repository: Aiko-IT-Systems/DisCatSharp.Extensions.Docs | |
token: ${{ secrets.NYUW_TOKEN_GH }} | |
- name: Purge old docs | |
shell: pwsh | |
run: Get-ChildItem -Exclude .git* | Remove-Item -Recurse -Force | |
- name: Download packed docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: dcs-ext-docs.zip | |
- name: Extract new docs | |
run: unzip dcs-ext-docs.zip -d . | |
- name: Deleze zip | |
run: rm dcs-ext-docs.zip | |
- name: Delete packed docs | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: dcs-ext-docs.zip | |
- name: Add .htaccess | |
run: rm -f .htaccess && wget https://gist.githubusercontent.com/Lulalaby/8a032d0ddebb9125691094edc67b6593/raw/0c4bf0423cfe334fdd5092b014d2481759dd052a/.htaccess | |
- name: Set access rights | |
run: sudo chmod 777 -R . | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@main | |
with: | |
default_author: user_info | |
author_name: NyuwBot | |
author_email: [email protected] | |
committer_name: NyuwBot | |
committer_email: [email protected] | |
commit: --signoff | |
message: 'Docs update for https://github.com/${{github.repository}}/commit/${{github.sha}}' |