|
5 | 5 | push: |
6 | 6 | branches: ["master"] |
7 | 7 |
|
8 | | - |
9 | 8 | jobs: |
10 | 9 | build: |
11 | 10 | runs-on: ubuntu-24.04 |
12 | 11 | permissions: |
13 | 12 | contents: write |
14 | 13 | steps: |
15 | | - - uses: actions/checkout@v4 |
16 | | - with: |
17 | | - persist-credentials: false |
18 | | - fetch-depth: 0 # Fetch the full history |
19 | | - ref: ${{ github.ref }} # Check out the current branch or tag |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + persist-credentials: false |
| 17 | + fetch-depth: 0 # Fetch the full history |
| 18 | + ref: ${{ github.ref }} # Check out the current branch or tag |
20 | 19 |
|
21 | | - - name: Fetch tags only |
22 | | - run: git fetch --tags --no-recurse-submodules |
| 20 | + - name: Fetch tags only |
| 21 | + run: git fetch --tags --no-recurse-submodules |
23 | 22 |
|
24 | | - - name: Set up Python |
25 | | - uses: actions/setup-python@v4 |
26 | | - with: |
27 | | - python-version: "3.10" |
| 23 | + - name: Set up Python |
| 24 | + uses: actions/setup-python@v4 |
| 25 | + with: |
| 26 | + python-version: "3.10" |
28 | 27 |
|
29 | | - - name: Install dependencies |
30 | | - run: | |
31 | | - python -m pip install --upgrade pip |
32 | | - pip install -e .[docs] |
| 28 | + - name: Install uv and dependencies |
| 29 | + run: | |
| 30 | + curl -LsSf https://astral.sh/uv/0.9.8/install.sh | sh |
| 31 | + uv sync --group docs |
33 | 32 |
|
34 | | - - name: Build documentation |
35 | | - run: sphinx-multiversion docs/source docs/build/html --keep-going --no-color |
| 33 | + - name: Build documentation |
| 34 | + run: uv run sphinx-multiversion docs/source docs/build/html --keep-going --no-color |
36 | 35 |
|
37 | | - - name: Get the latest tag |
38 | | - run: | |
39 | | - # Fetch all tags |
40 | | - git fetch --tags |
41 | | - # Get the latest tag |
42 | | - latest_tag=$(git tag --sort=-creatordate | head -n 1) |
43 | | - echo "LATEST_RELEASE=$latest_tag" >> $GITHUB_ENV |
| 36 | + - name: Get the latest tag |
| 37 | + run: | |
| 38 | + # Fetch all tags |
| 39 | + git fetch --tags |
| 40 | + # Get the latest tag |
| 41 | + latest_tag=$(git tag --sort=-creatordate | head -n 1) |
| 42 | + echo "LATEST_RELEASE=$latest_tag" >> $GITHUB_ENV |
44 | 43 |
|
45 | | - - name: Generate index.html for judge0.github.io/judge0-python. |
46 | | - run: | |
47 | | - echo '<!DOCTYPE html> |
48 | | - <html> |
49 | | - <head> |
50 | | - <meta http-equiv="refresh" content="0; URL=${{ env.latest_release }}/index.html"> |
51 | | - </head> |
52 | | - </html>' > docs/build/html/index.html |
53 | | - env: |
54 | | - latest_release: ${{ env.LATEST_RELEASE }} |
| 44 | + - name: Generate index.html for judge0.github.io/judge0-python. |
| 45 | + run: | |
| 46 | + echo '<!DOCTYPE html> |
| 47 | + <html> |
| 48 | + <head> |
| 49 | + <meta http-equiv="refresh" content="0; URL=${{ env.latest_release }}/index.html"> |
| 50 | + </head> |
| 51 | + </html>' > docs/build/html/index.html |
| 52 | + env: |
| 53 | + latest_release: ${{ env.LATEST_RELEASE }} |
55 | 54 |
|
56 | | - - name: Upload artifacts |
57 | | - uses: actions/upload-artifact@v4 |
58 | | - with: |
59 | | - name: html-docs |
60 | | - path: docs/build/html/ |
| 55 | + - name: Upload artifacts |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: html-docs |
| 59 | + path: docs/build/html/ |
61 | 60 |
|
62 | | - - name: Deploy |
63 | | - uses: peaceiris/actions-gh-pages@v3 |
64 | | - if: github.ref == 'refs/heads/master' |
65 | | - with: |
66 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
67 | | - publish_dir: docs/build/html |
| 61 | + - name: Deploy |
| 62 | + uses: peaceiris/actions-gh-pages@v3 |
| 63 | + if: github.ref == 'refs/heads/master' |
| 64 | + with: |
| 65 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + publish_dir: docs/build/html |
0 commit comments