summaryrefslogtreecommitdiffstats
path: root/.github/workflows/test-docs.yml
blob: 2dd6a31d1a499013d24447662a2a6b69b422b64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Small CI workflow to test if mkdocs documentation can be successfully built.

name: test docs
on:
  workflow_dispatch:
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }}

jobs:
  pre-job:
    runs-on: ubuntu-latest
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0
        with:
          skip_after_successful_duplicate: "true"
          paths: '["docs/**", ".github/workflows/docs.yml", ".github/workflows/test-docs.yml"]'
          do_not_skip: '["workflow_dispatch"]'

  test-build-documentation:
    name: Test building docs
    needs: pre-job
    if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
        with:
          fetch-depth: 0

      - uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
        with:
          python-version: 3.11

      - name: Install Python dependencies
        run: pip install -r docs/requirements.txt

      - name: Build docs with mkdocs
        run: |
          cd docs
          mkdocs build