|
1 | 1 | name: "Documentation"
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - develop |
7 |
| - - master |
8 |
| - schedule: |
9 |
| - - cron: "37 23 * * 2" |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - master |
| 8 | + schedule: |
| 9 | + - cron: "37 23 * * 2" |
10 | 10 |
|
11 | 11 | permissions:
|
12 |
| - contents: read |
13 |
| - pages: write |
14 |
| - id-token: write |
| 12 | + contents: read |
| 13 | + pages: write |
| 14 | + id-token: write |
15 | 15 |
|
16 | 16 | concurrency:
|
17 |
| - group: "pages" |
18 |
| - cancel-in-progress: false |
| 17 | + group: "pages" |
| 18 | + cancel-in-progress: false |
19 | 19 |
|
20 | 20 | jobs:
|
21 |
| - generate: |
22 |
| - name: Generate |
23 |
| - # if: needs.changes.outputs.docs == 'true' |
24 |
| - # needs: changes |
25 |
| - runs-on: ubuntu-latest |
26 |
| - env: |
27 |
| - PYTHONPATH: src/ |
28 |
| - steps: |
29 |
| - - uses: actions/checkout@v4 |
| 21 | + changes: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + timeout-minutes: 1 |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + shell: bash |
| 27 | + outputs: |
| 28 | + run_tests: ${{ steps.changes.outputs.docs }} |
| 29 | + steps: |
| 30 | + - name: Checkout code |
| 31 | + |
| 32 | + - id: changes |
| 33 | + name: Check for file changes |
| 34 | + uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 |
| 35 | + with: |
| 36 | + base: ${{ github.ref }} |
| 37 | + token: ${{ github.token }} |
| 38 | + filters: .github/file-filters.yml |
30 | 39 |
|
31 |
| - - name: Set up Python |
32 |
| - uses: actions/setup-python@v4 |
33 |
| - with: |
34 |
| - python-version: "3.12" |
| 40 | + generate: |
| 41 | + name: Generate |
| 42 | + if: needs.changes.outputs.docs == 'true' |
| 43 | + needs: changes |
| 44 | + runs-on: ubuntu-latest |
| 45 | + env: |
| 46 | + PYTHONPATH: src/ |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
35 | 49 |
|
36 |
| - - uses: yezz123/setup-uv@v4 |
| 50 | + - name: Set up Python |
| 51 | + uses: actions/setup-python@v4 |
| 52 | + with: |
| 53 | + python-version: "3.12" |
37 | 54 |
|
38 |
| - - uses: actions/cache/restore@v4 |
39 |
| - id: restore-cache |
40 |
| - with: |
41 |
| - path: .venv |
42 |
| - key: ${{ runner.os }}-${{ hashFiles('**/uv.lock') }} |
| 55 | + - uses: yezz123/setup-uv@v4 |
43 | 56 |
|
44 |
| - - name: Install dependencies |
45 |
| - run: uv sync --only-group docs |
| 57 | + - uses: actions/cache/restore@v4 |
| 58 | + id: restore-cache |
| 59 | + with: |
| 60 | + path: .venv |
| 61 | + key: ${{ runner.os }}-${{ hashFiles('**/uv.lock') }} |
46 | 62 |
|
47 |
| - - name: Build Doc |
48 |
| - run: .venv/bin/mkdocs build -d ./docs/output |
| 63 | + - name: Install dependencies |
| 64 | + run: uv sync --only-group docs |
49 | 65 |
|
50 |
| - - uses: actions/cache/save@v4 |
51 |
| - id: cache |
52 |
| - if: always() && steps.restore-cache.outputs.cache-hit != 'true' |
53 |
| - with: |
54 |
| - path: .venv |
55 |
| - key: ${{ runner.os }}-${{ hashFiles('**/uv.lock') }} |
56 |
| - - name: Upload artifact |
57 |
| - uses: actions/upload-pages-artifact@v3 |
58 |
| - with: |
59 |
| - path: ./docs/output |
| 66 | + - name: Build Doc |
| 67 | + run: .venv/bin/mkdocs build -d ./docs/output |
60 | 68 |
|
61 |
| - # Deployment job |
62 |
| - deploy: |
63 |
| - needs: generate |
64 |
| - environment: |
65 |
| - name: github-pages |
66 |
| - url: ${{ steps.deployment.outputs.page_url }} |
67 |
| - runs-on: ubuntu-latest |
68 |
| - steps: |
69 |
| - - name: Deploy to GitHub Pages |
70 |
| - id: deployment |
71 |
| - uses: actions/deploy-pages@v4 |
| 69 | + - uses: actions/cache/save@v4 |
| 70 | + id: cache |
| 71 | + if: always() && steps.restore-cache.outputs.cache-hit != 'true' |
| 72 | + with: |
| 73 | + path: .venv |
| 74 | + key: ${{ runner.os }}-${{ hashFiles('**/uv.lock') }} |
| 75 | + - name: Upload artifact |
| 76 | + uses: actions/upload-pages-artifact@v3 |
| 77 | + with: |
| 78 | + path: ./docs/output |
| 79 | + |
| 80 | + # Deployment job |
| 81 | + deploy: |
| 82 | + needs: generate |
| 83 | + environment: |
| 84 | + name: github-pages |
| 85 | + url: ${{ steps.deployment.outputs.page_url }} |
| 86 | + runs-on: ubuntu-latest |
| 87 | + steps: |
| 88 | + - name: Deploy to GitHub Pages |
| 89 | + id: deployment |
| 90 | + uses: actions/deploy-pages@v4 |
0 commit comments