diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 20a2a69496d..96f29a897db 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -75,6 +75,20 @@ jobs: - name: Install package run: pip install -e . + - name: Set profiling option + run: | + if [[ $EVENT == pull_request_target ]]; then + echo "DISABLE_PROFILING=1" >> $GITHUB_ENV + + else + echo "DISABLE_PROFILING=0" >> $GITHUB_ENV + + fi + + cat $GITHUB_ENV + env: + EVENT: ${{ github.event_name }} + - name: Build documentation run: cd docs/ && make html CORES=auto diff --git a/docs/conf.py b/docs/conf.py index 92e1d5441e5..c0d0a030188 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -68,6 +68,9 @@ exclude_patterns.append("resources/research_done_using_TARDIS/ads.ipynb") exclude_patterns.append("physics/energy_input/gammaray_deposition.ipynb") +if os.getenv("DISABLE_PROFILING"): + exclude_patterns.append("contributing/development/profiling/**.ipynb") + # This is added to the end of RST files - a good place to put substitutions to # be used globally. rst_epilog = """