diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-10-24 08:46:14 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-10-24 09:23:18 +0200 |
| commit | 56f084389a3eb6b34df86af347ce60acdeb6106b (patch) | |
| tree | 3e3fc02086b7b246752a6dc4804551dd05b4dfa3 /.github | |
| parent | 1f3a6e09d3b605fb70cd0dd2165373814feb2eda (diff) | |
Actions + Docs: Use Sphinx docs for Python
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/deploy.yml | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5735b1b..103472c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,6 @@ # Adapted from https://github.com/rust-lang/mdBook/wiki/Automated-Deployment:-GitHub-Actions#github-pages-deploy -name: Deploy +name: Build docs on: push: branches: @@ -8,7 +8,7 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: @@ -19,23 +19,65 @@ jobs: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.18/mdbook-v0.4.18-x86_64-unknown-linux-gnu.tar.gz -o mdbook.tar.gz # Verify hash echo "d276b0e594d5980de6a7917ce74c348f28d3cb8b353ca4eaae344ae8a4c40bea mdbook.tar.gz" | sha256sum --check + # Extract mkdir mdbook tar -xzf mdbook.tar.gz --directory mdbook echo `pwd`/mdbook >> $GITHUB_PATH + - name: Install sphinx + run: | + # Install python dependencies + sudo apt -y install python3 python3-pip python3-sphinx + + # Install rtd theme + pip install sphinx_rtd_theme + - name: Install go + run: | + sudo apt -y install golang-go + - name: Build & Install python-eduvpn-common + run: | + # Make go library + make + + # Go to Python wrapper + cd wrappers/python + + # Make wheel + make pack + + # Install wheel + pip3 install dist/*.whl - name: Deploy GitHub Pages run: | - # Go to docs directory - cd docs + # Build Sphinx + cd wrappers/python/docs + make html + + # Go to docs directory & build mdbook + cd ../../../docs mdbook build + + # gh pages branch settings git worktree add gh-pages gh-pages git config user.name "Deploy from CI" git config user.email "" cd gh-pages + # Delete the ref to avoid keeping history. git update-ref -d refs/heads/gh-pages rm -rf * + + # move mdbook files mv ../book/* . + + # move sphinx files + mkdir api/python/rtd + mv ../../wrappers/python/docs/build/html/* api/python/rtd + + # Disable jekyll as otherwise it won't find our sphinx paths + # that start with underscore + touch .nojekyll + git add . git commit -m "Deploy $GITHUB_SHA to gh-pages" git push --force |
