From 553a17db7a107a7c1cdc046127d11fae19b1828c Mon Sep 17 00:00:00 2001 From: RobinTTY Date: Sat, 17 Aug 2024 18:31:25 +0200 Subject: [PATCH] Update deploy script --- .github/workflows/deploy-docs.yml | 41 +++++++++++++++++++++---------- docs/docusaurus.config.ts | 2 ++ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 3311a97..e3bc134 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -6,30 +6,45 @@ on: - main jobs: - deploy: - name: Deploy to GitHub Pages + build: + name: Build Docusaurus runs-on: ubuntu-latest defaults: run: working-directory: ./docs/ steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 with: - node-version: 16.x + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 18 cache: npm - cache-dependency-path: ./docs/ - name: Install dependencies run: npm ci - name: Build website run: npm run build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: docs - publish_dir: ./docs/docusaurus/build - user_name: RobinTTY - user_email: muellerobin95@gmail.com + path: build + + deploy: + name: Deploy to GitHub Pages + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 43d8d32..018de9f 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -14,8 +14,10 @@ const config: Config = { baseUrl: `/${projectName}/`, organizationName: "RobinTTY", projectName: projectName, + deploymentBranch: "docs", onBrokenLinks: "throw", onBrokenMarkdownLinks: "warn", + trailingSlash: false, i18n: { defaultLocale: "en",