docs: formatting of LICENSE #507
Workflow file for this run
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: Docs | |
on: [pull_request, push] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
cd yahpo_gym | |
pip install -e .[docs] | |
- name: Make docs | |
run: | | |
cd yahpo_gym/docs | |
printf "data_path: ~/file/to/data" >> ~/.config/yahpo_gym | |
pip install sphinx_rtd_theme | |
make html | |
- name: Pull latest gh-pages | |
if: (contains(github.ref, 'main')) && github.event_name == 'push' | |
run: | | |
cd .. | |
git clone https://github.com/slds-lmu/yahpo_gym.git --branch gh-pages --single-branch gh-pages | |
- name: Copy new docs into gh-pages | |
if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push' | |
run: | | |
branch_name=${GITHUB_REF##*/} | |
cd ../gh-pages | |
rm -rf $branch_name | |
rm -rf docs/* | |
cp -r ../yahpo_gym/yahpo_gym/docs/build/html $branch_name | |
- name: Push to gh-pages | |
if: (contains(github.ref, 'main')) && github.event_name == 'push' | |
run: | | |
last_commit=$(git log --pretty=format:"%an: %s") | |
cd ../gh-pages | |
branch_name=${GITHUB_REF##*/} | |
mv -f $branch_name/* docs | |
rm -r $branch_name | |
git add docs | |
git config --global user.name 'Github Actions' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git commit --allow-empty -am "$last_commit" | |
git push |