Update contributing guide. Update tests to use default client fixtures. #65
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: "Sphinx: Render docs" | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 # Fetch the full history | |
ref: ${{ github.ref }} # Check out the current branch or tag | |
- name: Fetch tags only | |
run: git fetch --tags --no-recurse-submodules | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r docs/requirements.txt | |
- name: Build documentation | |
run: sphinx-multiversion docs/source docs/build/html --keep-going --no-color | |
- name: Get the latest tag | |
run: | | |
# Fetch all tags | |
git fetch --tags | |
# Get the latest tag | |
latest_tag=$(git tag --sort=-creatordate | head -n 1) | |
echo "LATEST_RELEASE=$latest_tag" >> $GITHUB_ENV | |
- name: Generate index.html for judge0.github.io/judge0-python. | |
run: | | |
echo '<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="refresh" content="0; URL=${{ env.latest_release }}/index.html"> | |
</head> | |
</html>' > docs/build/html/index.html | |
env: | |
latest_release: ${{ env.LATEST_RELEASE }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-docs | |
path: docs/build/html/ | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build/html |