summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/deploy-docs.yml47
1 files changed, 37 insertions, 10 deletions
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index a706d674..7cd2cf57 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -6,16 +6,18 @@ on:
jobs:
documentation:
+
+ # Do not attempt to deploy documentation on forks
+ if: github.repository_owner == 'networkx'
+
runs-on: Ubuntu-20.04
- strategy:
- matrix:
- python-version: [3.8]
+
steps:
- uses: actions/checkout@v2
- - name: Set up Python ${{ matrix.python-version }}
+ - name: Set up Python
uses: actions/setup-python@v2
with:
- python-version: ${{ matrix.python-version }}
+ python-version: '3.8'
- name: Before install
run: |
@@ -25,8 +27,6 @@ jobs:
sudo apt-get install fonts-freefont-otf xindy
sudo apt-get install libgeos-dev libproj-dev
sudo apt-get install libspatialindex-dev
- python3 -m venv ~/venv
- source ~/venv/bin/activate
- name: Mayavi setup
run: |
@@ -48,11 +48,38 @@ jobs:
pip install .
pip list
+ # To set up a cross-repository deploy key:
+ # 1. Create a key pair:
+ # `ssh-keygen -t ed25519 -C "nx_doc_deploy_bot@nomail"`
+ # 2. Add the public key to the networkx/documentation repo
+ # - Settings -> Deploy keys -> Add new
+ # - Make sure the key has write permissions
+ # 3. Add private key as a secret to networkx/networkx repo
+ # - Settings -> Secrets -> New Repository Secret
+ # - Make sure the name is the same as below: CI_DEPLOY_KEY
+ - name: Install SSH agent
+ if: github.ref == 'refs/heads/master'
+ uses: webfactory/ssh-agent@v0.4.1
+ with:
+ ssh-private-key: ${{ secrets.CI_DEPLOY_KEY }}
+
- name: Build docs
+ if: github.ref == 'refs/heads/master'
run: |
- echo "To do"
+ export DISPLAY=:99
+ make -C doc/ html
+ make -C doc/ latexpdf LATEXOPTS="-file-line-error -halt-on-error"
+ cp -a doc/build/latex/networkx_reference.pdf doc/build/html/_downloads/.
- name: Deploy docs
- run: |
- echo "To do"
+ if: github.ref == 'refs/heads/master'
+ uses: JamesIves/github-pages-deploy-action@releases/v3
+ with:
+ GIT_CONFIG_NAME: nx-doc-deploy-bot
+ GIT_CONFIG_EMAIL: nx-doc-deploy-bot@nomail
+ FOLDER: doc/build/html
+ REPOSITORY_NAME: networkx/documentation
+ BRANCH: gh-pages
+ TARGET_FOLDER: latest
+ SSH: true