Skip to content

Commit

Permalink
update build their docs
Browse files Browse the repository at this point in the history
  • Loading branch information
negin513 committed May 8, 2024
1 parent b74284a commit 36344de
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: JupyterBook
#name: Build and Publish JupyterBook to GitHub Pages
name: Build and Publish CTSM Docs

on:
[push]
push:
branches:
- master # ctsm main is named master!

pull_request:
branches:
- master

jobs:
build:
Expand All @@ -11,21 +16,37 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.x
- name: Install Python dependencies
run: |
sudo apt-get install python3-pip
#pip install git+git://github.com/executablebookproject/cli.git#egg=master
pip install ghp-import
#pip install -r book/requirements.txt
pip install jupyter-book
PATH="${PATH}:${HOME}/.local/bin"
- name: Build book TOC file
- name: Build documentation
run: |
docker pull escomp/base
mkdir ~/ctsm-repos/ctsm-docs
cd ~/ctsm-repos/ctsm/doc
./build_docs -b ~/ctsm-docs -d
# not needed if you get rid of ctsm-docs seperate repo
- name: Commit documentation for ctsm-docs
run: |
cd ~/ctsm-repos/ctsm-docs
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation"
git commit -m "Update documentation [skip ci]" || echo "No changes to commit"
git push origin gh-pages
# Better Solution they can use:
- name: Push to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./ctsm-docs
publish_branch: gh-pages
keep_files: true

0 comments on commit 36344de

Please sign in to comment.