From cb0e8339f2b6e1fdc93855fe0d7049f0786afb45 Mon Sep 17 00:00:00 2001 From: Naser Mahfouz Date: Fri, 22 Sep 2023 18:10:18 -0700 Subject: [PATCH] add ghp preview --- .github/workflows/e3sm-gh-pages.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e3sm-gh-pages.yml b/.github/workflows/e3sm-gh-pages.yml index c57fa5db4c8a..f4a51215a2d9 100644 --- a/.github/workflows/e3sm-gh-pages.yml +++ b/.github/workflows/e3sm-gh-pages.yml @@ -33,7 +33,18 @@ jobs: # build every time (PR or push to master) - name: Build run: mkdocs build --strict --verbose - # deploy only when it is a push + # Only deploy to the main github page when there is a push to master - if: ${{ github.event_name == 'push' }} - name: Deploy - run: mkdocs gh-deploy + name: GitHub Pages action + uses: JamesIves/github-pages-deploy-action@v4 + with: + # Do not remove existing pr-preview pages + clean-exclude: pr-preview + folder: ./site/ + # If it's a PR from within the same repo, deploy to a preview page + # For security reasons, PRs from forks cannot write into gh-pages for now + - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} + name: Preview docs + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./site/