Deploy Docs #21
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
name: Deploy Docs | |
on: | |
workflow_dispatch: # manual trigger to kick off workflow | |
inputs: | |
logLevel: | |
description: "Log level" | |
required: true | |
default: "warning" | |
jobs: | |
deploy_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Checkout iblenv doc build branch | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Checkout ibllib doc build branch | |
uses: actions/checkout@v3 | |
with: | |
repository: int-brain-lab/ibllib | |
ref: develop | |
path: ibllib-repo | |
- name: Checkout ONE-api | |
uses: actions/checkout@v3 | |
with: | |
repository: int-brain-lab/one | |
path: ONE | |
- name: Checkout iblatlas | |
uses: actions/checkout@v3 | |
with: | |
repository: int-brain-lab/iblatlas | |
path: iblatlas | |
- name: Move ibllib and ONE up a directory | |
run: | | |
mv ibllib-repo .. | |
mv ONE .. | |
mv iblatlas .. | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install docs requirements | |
run: | | |
sudo apt-get install -y pandoc | |
pip install -r docs_gh_pages/requirements-docs.txt | |
pip install -e ../ibllib-repo | |
pip install jupyter | |
- name: ONE setup and build docs | |
run: | | |
cd docs_gh_pages | |
python scripts/one_setup.py | |
python make_script.py -e | |
ls -l _build | |
- name: Clean up documentation | |
run: | | |
cd docs_gh_pages | |
python make_script.py -pc | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/int-brain-lab/iblenv.git --branch gh-pages --single-branch gh-pages | |
cp -r docs_gh_pages/_build/html/* gh-pages/ | |
cd gh-pages | |
touch .nojekyll | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
force: True | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Copy files to the production website with the AWS CLI | |
run: | | |
cd docs_gh_pages/_build/html | |
aws s3 sync . s3://docs.internationalbrainlab.org |