forked from ESCOMP/CTSM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|