Skip to content

fix!: nullability & other things #682

fix!: nullability & other things

fix!: nullability & other things #682

name: "Test Documentation"
on:
pull_request:
merge_group:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
GH_TOKEN: ${{ github.token }}
jobs:
build:
timeout-minutes: 25
runs-on: ubuntu-latest
name: Build documentation
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.NYUW_TOKEN_GH }}
- name: Checkout PR if nessesary
if: github.event_name == 'pull_request'
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.401
- name: Install DocFX
run: dotnet tool update -g docfx --prerelease
continue-on-error: true
- name: Restore packages
run: dotnet restore DisCatSharp.sln
- name: Build library
run: dotnet build -c Release -v minimal -f net7.0 --no-restore DisCatSharp.sln
timeout-minutes: 7
continue-on-error: true
- name: Build Docs
run: docfx DisCatSharp.Docs/docfx.json --logLevel Verbose
- name: Pack Docs
shell: pwsh
run: ./DisCatSharp.Tools/pack-docs.ps1 -DocsPath "./DisCatSharp.Docs" -OutputPath "./" -PackageName "dcs-docs-preview"
- name: Upload packed docs
uses: actions/upload-artifact@v3
with:
name: dcs-docs-preview.zip
path: dcs-docs-preview.zip
retention-days: 2
test_documentation:
runs-on: ubuntu-latest
name: Test documentation
needs: build
steps:
- name: Dynamically create branch
uses: GuillaumeFalourd/[email protected]
with:
repository_owner: Aiko-IT-Systems
repository_name: DisCatSharp.Docs
new_branch_name: ${{ github.head_ref }}
access_token: ${{ secrets.NYUW_TOKEN_GH }}
ignore_branch_exists: true
git_user_name: NyuwBot
git_user_email: [email protected]
- name: Checkout docs repository
uses: actions/checkout@v4
with:
repository: Aiko-IT-Systems/DisCatSharp.Docs
token: ${{ secrets.NYUW_TOKEN_GH }}
ref: ${{ github.head_ref }}
- name: Purge old docs
shell: pwsh
run: Get-ChildItem -Exclude .git* | Remove-Item -Recurse -Force
- name: Download packed docs
uses: actions/download-artifact@v3
with:
name: dcs-docs-preview.zip
- name: Extract new docs
run: unzip dcs-docs-preview.zip -d .
- name: Deleze zip
run: rm dcs-docs-preview.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 changes
run: |
git config user.name NyuwBot
git config user.email [email protected]
git add .
git commit -m "Test-Docs update (https://github.com/${{github.repository}}/commit/${{github.sha}})"
git push -f
- name: Add PR Comment
if: always()
uses: mshick/add-pr-comment@v2
with:
refresh-message-position: true
message-success: |
Documentation test build passed! :tada:
Visit the cloudflare action run in https://github.com/Aiko-IT-Systems/DisCatSharp.Docs/commits/${{github.head_ref}} for details :3
![gif](https://media.tenor.com/3PjRNS8paykAAAAC/pat-pat-head.gif)
message-failure: "Documentation test build failed! :x:"