diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd1d42b9..b7759223 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,14 @@ jobs: - name: Print MyST version run: myst --version - - name: Build website as static HTML + - name: Build website as static HTML (for PR) + if: github.event_name == 'pull_request' + run: | + echo "Building MyST website without setting BASE_URL" + myst build --html + + - name: Build website as static HTML (for deploy) + if: github.event_name != 'pull_request' run: | echo "Building MyST website using BASE_URL=" $BASE_URL myst build --html @@ -40,9 +47,9 @@ jobs: BASE_URL: /${{ github.event.repository.name }} # Store the website as a build artifact so we can deploy it later + # or preview the website in a PR. - name: Upload HTML website as an artifact - # Only if not a pull request - if: success() && github.event_name != 'pull_request' + if: success() uses: actions/upload-artifact@v4 with: name: html-${{ github.sha }}