blob: f49a9e660b4d1230801e8831ff513a0b37efa237 [file] [log] [blame]
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +01001name: Documentation Build
2
3on:
Gaute Svanes Lunde481a6fd2023-01-17 22:25:34 +01004 pull_request:
5 types: [opened, synchronize, reopened]
6 branches:
7 - master
8 paths:
9 - '.github/workflows/docbuild.yaml'
10 - '**.md'
11 - 'docs/**'
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010012 push:
13 branches:
14 - master
15
16permissions:
17 contents: write
18
19jobs:
Gaute Svanes Lunde481a6fd2023-01-17 22:25:34 +010020 build-and-publish:
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010021 runs-on: ubuntu-latest
22
23 steps:
24 - name: Checkout the code
dependabot[bot]d5c39212023-02-17 08:55:18 -080025 uses: actions/checkout@v3
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010026 with:
27 path: matter
28 fetch-depth: 0
29 - name: Install Python
Arkadiusz Bokowy3d9bc882023-02-14 03:01:17 +010030 uses: actions/setup-python@v4
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010031 with:
32 python-version: 3.8
Arkadiusz Bokowy3d9bc882023-02-14 03:01:17 +010033 cache-dependency-path: matter/docs/requirements.txt
34 cache: pip
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010035 - name: Install base dependencies
36 working-directory: matter
37 run: |
38 sudo pip3 install -U pip
39 pip3 install -r docs/requirements.txt
40 - name: Build documentation
41 working-directory: matter/docs
42 run: |
43 mkdir -p _build/src
44 make html
45 touch _build/html/.nojekyll
46 - name: Deploy to gh-pages
Gaute Svanes Lunde481a6fd2023-01-17 22:25:34 +010047 if: github.repository == 'project-chip/connectedhomeip' && github.event_name == 'push' && github.ref_name == 'master'
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +010048 uses: peaceiris/actions-gh-pages@v3
49 with:
50 deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }}
51 external_repository: project-chip/connectedhomeip-doc
52 publish_dir: matter/docs/_build/html
53 # Keep only the latest version of the documentation
54 force_orphan: true