diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9ea5bfc57..a8dc8f71e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,105 +1,105 @@ name: "Documentation" on: push: branches: [ main ] workflow_dispatch: env: DOTNET_NOLOGO: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true jobs: build: runs-on: ubuntu-latest name: Build documentation steps: - name: Checkout repository uses: actions/checkout@v3 with: path: DisCatSharp - name: Setup .NET uses: actions/setup-dotnet@v3.0.2 with: dotnet-version: 6.0.400 - name: Restore packages working-directory: DisCatSharp run: dotnet restore - name: Build library working-directory: DisCatSharp run: dotnet build -c Release - name: Test library working-directory: DisCatSharp run: dotnet test -c Release continue-on-error: true - name: Build Docs working-directory: DisCatSharp shell: pwsh run: ./rebuild-docs.ps1 -DocsPath "./DisCatSharp.Docs" -Output ".." -PackageName "dcs-docs" - name: Upload packed docs uses: actions/upload-artifact@v3 with: name: dcs-docs.zip path: dcs-docs.zip retention-days: 30 documentation: runs-on: windows-latest name: Upload documentation needs: build steps: - name: Checkout docs repository uses: actions/checkout@v3 with: repository: Aiko-IT-Systems/DisCatSharp.Docs path: DisCatSharp.Docs token: ${{ secrets.NYUW_TOKEN_GH }} - name: Download packed docs uses: actions/download-artifact@v3 with: name: dcs-docs.zip - name: Purge old docs working-directory: DisCatSharp.Docs shell: pwsh run: Get-ChildItem -Exclude .git*,.htaccess | Remove-Item -Recurse -Force - name: Extract new docs shell: pwsh run: Expand-Archive -Path dcs-docs.zip DisCatSharp.Docs/ - name: Delete packed docs uses: geekyeggo/delete-artifact@v2 with: name: dcs-docs.zip - name: Commit and push changes uses: EndBug/add-and-commit@main with: cwd: DisCatSharp.Docs default_author: user_info author_name: DisCatSharp author_email: team@aitsys.dev committer_name: NyuwBot committer_email: nyuw@aitsys.dev commit: --signoff message: 'Docs update for commit ${{ github.repository }} (${{ github.sha }})' publish-main: runs-on: ubuntu-latest name: Publish documentation on main server needs: documentation steps: - name: Get SSH Agent - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.AITSYS_SSH }} - name: Publish on server continue-on-error: true run: ssh -o StrictHostKeyChecking=no -T root@80.153.182.68 -f 'cd /var/www/dcs.aitsys.dev/docs && git pull -f' publish-backup: runs-on: ubuntu-latest name: Publish documentation on backup server needs: documentation steps: - name: Get SSH Agent - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.AITSYS_SSH }} - name: Publish on server continue-on-error: true run: ssh -o StrictHostKeyChecking=no -T root@207.180.240.241 -f 'cd /var/www/dcsdocs && git pull -f'