xonsh/.github/workflows/docs.yml

55 lines
1.6 KiB
YAML
Raw Normal View History

name: Build and deploy docs
on:
push:
branches:
- main
tags:
- '*.*.*'
2022-01-18 23:07:14 +05:30
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
if: github.repository_owner == 'xonsh'
runs-on: ubuntu-latest
name: Xonsh docs to gh-pages
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
2022-05-10 21:09:43 +05:30
cache-dependency-path: 'pyproject.toml'
- run: pip install -e '.[doc]'
- name: Build Docs
run: cd docs && make html
- uses: tibdex/github-app-token@v1
if: ${{ github.event_name != 'pull_request' }}
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
repository: xonsh/xonsh-docs
- name: Deploy to dev if not tagged
2022-01-18 23:07:14 +05:30
if: github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v')
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ steps.generate-token.outputs.token }}
external_repository: xonsh/xonsh-docs
publish_dir: ./docs/_build/html
destination_dir: dev # latest as in main branch
- name: Deploy to stable if tagged
2022-01-18 23:07:14 +05:30
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ steps.generate-token.outputs.token }}
external_repository: xonsh/xonsh-docs
publish_dir: ./docs/_build/html
# # todo: implement versioned docs