earth-distances #67
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
# | |
# Build documentation and deploy | |
# | |
name: Docs | |
on: | |
# pull_request: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- '.github/workflows/**' | |
defaults: | |
run: | |
# default to use bash shell | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: Build the website | |
run: make -C docs clean html | |
- name: Deploy to gh-pages | |
if: success() && github.event_name == 'push' | |
# Don't use tags: https://julienrenaux.fr/2019/12/20/github-actions-security-risk/ | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html/ | |
# Only keep the latest commit to avoid bloating the repository | |
force_orphan: true | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |