Merge pull request #1274 from openml/develop #2251
This file contains hidden or 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@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: | | |
| pip install -e .[docs,examples,examples_unix] | |
| # dependency "fanova" does not work with numpy 1.24 or later | |
| # https://github.com/automl/fanova/issues/108 | |
| pip install numpy==1.23.5 | |
| - name: Make docs | |
| run: | | |
| cd doc | |
| make html | |
| - name: Check links | |
| run: | | |
| cd doc | |
| make linkcheck | |
| - name: Pull latest gh-pages | |
| if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push' | |
| run: | | |
| cd .. | |
| git clone https://github.com/openml/openml-python.git --branch gh-pages --single-branch gh-pages | |
| - name: Copy new doc 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 | |
| cp -r ../openml-python/doc/build/html $branch_name | |
| - name: Push to gh-pages | |
| if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push' | |
| run: | | |
| last_commit=$(git log --pretty=format:"%an: %s") | |
| cd ../gh-pages | |
| branch_name=${GITHUB_REF##*/} | |
| git add $branch_name/ | |
| git config --global user.name 'Github Actions' | |
| git config --global user.email 'not@mail.com' | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| git commit -am "$last_commit" | |
| git push |