From 942df4a9811a33ee2ff2cb74ef27204348e9b42a Mon Sep 17 00:00:00 2001 From: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com> Date: Sun, 11 Feb 2024 23:35:01 +0300 Subject: [PATCH] [CI] Docs action (#2841) * Create docs.yml * add PR trigger for testing * Update docs.yml * Update docs.yml - 3 * I Love CI/CD - 4 * ok this didn't fail before - 5 * my bad - 6 * move step so it fails right away * dot. - 8 * my bad x2 - 9 * IT'S ALIVE - 10 --- .github/workflows/docs.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..1b56965821 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,45 @@ +name: Deploy Docs + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Setup DocFX + run: dotnet tool install -g docfx --version 2.71.0 + + - name: Build DNet docs + run: docfx docs/docfx.json + + - name: Create Output Directory + run: mkdir output | cp -a docs/_site/. output/ + + - name: Auth DNet bot + id: bot_auth + uses: machine-learning-apps/actions-app-token@master + with: + APP_PEM: ${{ secrets.DNET_BOT_PEM }} + APP_ID: ${{ secrets.DNET_BOT_ID }} + + - name: Push to static docs + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ steps.bot_auth.outputs.app_token }} + with: + source-directory: 'output' + destination-github-username: 'discord-net' + destination-repository-name: 'docs-static' + user-email: dnetbot@discordnet.dev + target-branch: master