2022-01-18 22:08:27 +05:30
|
|
|
name: Build and deploy docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*.*.*'
|
2022-01-18 23:07:14 +05:30
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
2022-01-18 22:08:27 +05:30
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-05-23 19:49:14 +05:30
|
|
|
if: github.repository_owner == 'xonsh'
|
2022-01-18 22:08:27 +05:30
|
|
|
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]'
|
2022-01-18 22:08:27 +05:30
|
|
|
- name: Build Docs
|
|
|
|
run: cd docs && make html
|
|
|
|
- uses: tibdex/github-app-token@v1
|
2022-01-25 21:22:47 -05:00
|
|
|
if: ${{ github.event_name != 'pull_request' }}
|
2022-01-18 22:08:27 +05:30
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.APP_ID }}
|
|
|
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
2022-03-15 10:33:44 -04:00
|
|
|
repository: xonsh/xonsh-docs
|
2022-01-18 22:08:27 +05:30
|
|
|
- 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')
|
2022-01-18 22:08:27 +05:30
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
2022-03-15 10:39:19 -04:00
|
|
|
personal_token: ${{ steps.generate-token.outputs.token }}
|
2022-01-18 22:08:27 +05:30
|
|
|
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')
|
2022-01-18 22:08:27 +05:30
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
2022-03-15 10:39:19 -04:00
|
|
|
personal_token: ${{ steps.generate-token.outputs.token }}
|
2022-01-18 22:08:27 +05:30
|
|
|
external_repository: xonsh/xonsh-docs
|
|
|
|
publish_dir: ./docs/_build/html
|
|
|
|
# # todo: implement versioned docs
|
|
|
|
|
|
|
|
|