Skip to content

Documentation

Documentation #58

Workflow file for this run

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/setup-dotnet@v4.0.0
with:
dotnet-version: |
8.0.301
7.0.403
- 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
token: ${{ secrets.NYUW_TOKEN_GH }}
- 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: nyuw@aitsys.dev
committer_name: NyuwBot
committer_email: nyuw@aitsys.dev
commit: --signoff
message: 'Docs update for https://github.com/${{github.repository}}/commit/${{github.sha}}'