From d45046019392094e1da7d626bf20166a53e899f9 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 08:08:08 +0200 Subject: [PATCH] ci(docs): Use PUBLISH condition --- .github/workflows/docs.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 108ff2dfa..7d8299969 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,25 +34,26 @@ jobs: run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV - name: Install poetry + if: env.PUBLISH == 'true' run: pipx install "poetry==1.1.14" - name: Set up Python ${{ matrix.python-version }} + if: env.PUBLISH == 'true' uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'poetry' - - name: Add ~/.local/bin to PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Install dependencies [w/ docs] run: poetry install --extras "docs lint" - name: Build documentation + if: env.PUBLISH == 'true' run: | pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd - name: Push documentation to S3 + if: env.PUBLISH == 'true' uses: jakejarvis/s3-sync-action@v0.5.1 with: args: --acl public-read --follow-symlinks --delete @@ -64,6 +65,7 @@ jobs: SOURCE_DIR: "docs/_build/html" # optional: defaults to entire repository - name: Purge cache on Cloudflare + if: env.PUBLISH == 'true' uses: jakejarvis/cloudflare-purge-action@v0.3.0 env: CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}