Skip to content

Commit

Permalink
Merge branch 'mahf708/docs/improve-gh-pages-docs' (PR #5951)
Browse files Browse the repository at this point in the history
Adds docs preview to PR page. Preview appears in a comment.

This workflow will update the same comment if there are changes
(it won't pollute the PR page with more comments). Additionally,
I spaced out the GitHub action so that it is easier to read and maintain (and shortened the names)

[BFB]
  • Loading branch information
rljacob authored Oct 9, 2023
2 parents 2ff3742 + cb0e833 commit 589f08c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/e3sm-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 589f08c

Please sign in to comment.