From f41da04510cc7f919e9fa0fd1e5b923ef1a14755 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Sat, 24 Aug 2024 11:06:24 -0700 Subject: [PATCH] doc: Don't download external resources for PRs The privacy plugin downloads external resources (like fonts). This is not necessary for PRs as these builds are not published. --- .github/workflows/doc.yml | 1 + doc/mkdocs.yml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 5391b874..f923fcd5 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -45,6 +45,7 @@ jobs: working-directory: doc env: CLOUDFLARE_ANALYTICS_TOKEN: ${{ secrets.CLOUDFLARE_ANALYTICS_TOKEN }} + MAIN_BUILD: ${{ github.ref == 'refs/heads/main' }} - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index 9cacfa0a..ac681af7 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -62,7 +62,9 @@ exclude_docs: | plugins: - markdown-exec - privacy: - enabled: !ENV [CI, false] + # Don't download external resources in CI, + # except for main builds. + enabled: !ENV [MAIN_BUILD, false] - redirects: redirect_maps: 'how-to.md': 'recipes.md'