docs: update documentation #17
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_pages_workflow | |
on: [pull_request] | |
permissions: | |
pull-requests: write | |
jobs: | |
build_docs_job: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
python -m pip install --upgrade pip | |
echo "dir={$(pip cache dir)}" >> $GITHUB_OUTPUT | |
- name: pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/docs/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install docs requirements | |
run: | | |
python -m pip install -e . | |
python -m pip install -r docs/requirements.txt | |
- name: make the sphinx docs | |
run: | | |
make -C docs clean | |
make -C docs html | |
- uses: readthedocs/actions/preview@v1 | |
with: | |
project-slug: "trlx-stage" | |
project-language: "en" | |
message-template: "{docs-pr-index-url}" | |
# see: https://github.com/readthedocs/actions/tree/main/preview | |
# message-template (optional): Text message to be injected by the action in the Pull Request description. It supports the following placeholders to be replaced: | |
# {docs-pr-index-url}: URL to the root of the documentation for the Pull Request preview. | |
# platform (optional): Read the Docs Community (community) or Read the Docs for Business (business). (default: community) | |
# single-version (optional): Set this to 'true' if your project is single version, so we can link to the correct URL. (default: 'false') |