Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed Feb 29, 2024
1 parent c9de8f9 commit 39547ff
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:

- name: Install Seispy
run: |
VERSION=$(python setup.py --version)
pip install .
- name: Checkout to docs branch
Expand All @@ -63,12 +64,38 @@ jobs:
- name: Build documentation
run: |
make html
- name: Checkout the gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
# Checkout to this folder instead of the current one
path: deploy
# Download the entire history
fetch-depth: 0

- name: Copy documentation
run: |
if {{ steps.vars.outputs.branch }} == "dev"; then
version=“$(python setup.py --version)_$(git rev-parse --short HEAD)”
else
version=$(python setup.py --version)
fi
cd deploy
touch .nojekyll
echo -e "\nRemoving old files from previous builds of ${version}:"
rm -rvf dev_* ${version}
echo -e "\nCopying new files from ${version}:"
cp -rvf ../build/html ${version}
rm -rfv latest
ln -sfv ${version} latest
cd ..
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
publish_dir: deploy
# Only keep the latest commit to avoid bloating the repository
force_orphan: true
cname: seispy.xumijian.me
Expand Down
5 changes: 3 additions & 2 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

import os
import sys
sys.path.insert(0, os.path.abspath('./seispy/seispy'))
from importlib.metadata import version
# sys.path.insert(0, os.path.abspath('./seispy/seispy'))
# sys.path.insert(0, os.path.abspath('/Users/xumj/Codes/seispy/seispy'))


Expand All @@ -26,7 +27,7 @@
author = 'Mijian Xu'

# The short X.Y version
version = '1.3.5'
version = f'v{version('python-seispy')}'
# The full version, including alpha/beta/rc tags
release = version

Expand Down

0 comments on commit 39547ff

Please sign in to comment.