Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add markdown doc structure and gh-pages workflow #5942

Merged
merged 18 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/e3sm-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and deploy gh-pages branch with Mkdocs

on:
# Runs every time master branch is updated
push:
branches: ["master"]
# Runs every time a PR is open against master
pull_request:
branches: ["master"]
workflow_dispatch:

concurrency:
# Prevent 2+ copies of this workflow from running concurrently
group: e3sm-docs-action

jobs:
Build-and-Deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
fetch-depth: 0 # Needed, or else gh-pages won't be fetched, and push rejected
Copy link
Contributor

@bartgol bartgol Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we may want to use another action for deployment, which will get rid of the need for fetch-depth: 0. E.g., in scream repo we use JamesIves/github-pages-deploy-action@v4, which plays nicely with rossjrw/pr-preview-action@v1, which we use to deploy preview of PR docs.

As it is now, if running on a PR, this action only builds the docs but does not show it anywhere. We can merge as is, but I would soon work on making a preview of docs available on the PR page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes lets do that in a later PR.

submodules: false # speeds up clone and not building anything in submodules
- name: Show action trigger
run: echo "= The job was automatically triggered by a ${{github.event_name}} event."
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
- name: Install python deps
run: python3 -m pip install mkdocs-material pymdown-extensions mkdocs-monorepo-plugin mdutils
# build every time (PR or push to master)
- name: Build
run: mkdocs build --strict --verbose
# deploy only when it is a push
- if: ${{ github.event_name == 'push' }}
name: Deploy
run: mkdocs gh-deploy
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ buildnmlc
buildlibc
buildlib_cmakec

#the site directory
site

# Ignore emacs backup files
*~
Loading