Skip to content

Commit bd518ad

Browse files
gmarullcarlescufi
authored andcommitted
ci: add workflow to build and publish docs
Add a workflow that, for now, builds Doxygen docs and published them on Github pages. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 838de92 commit bd518ad

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/docs.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright (c) 2024, Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Documentation
5+
6+
on: [push, pull_request]
7+
8+
env:
9+
DOXYGEN_VERSION: 1.9.6
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install dependencies
19+
run: |
20+
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
21+
tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz
22+
echo "${PWD}/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
23+
pip install -r doc/requirements.txt
24+
25+
- name: Build
26+
run: |
27+
cd doc
28+
doxygen
29+
30+
SPHINXOPTS="-W" make html
31+
32+
mkdir deploy
33+
mv _build_doxygen/html deploy/doxygen
34+
mv _build_sphinx/html deploy/sphinx
35+
36+
- name: Setup pages
37+
if: github.event_name != 'pull_request'
38+
uses: actions/configure-pages@v4
39+
40+
- name: Upload pages artifact
41+
if: github.event_name != 'pull_request'
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: doc/deploy
45+
46+
- name: Upload artifacts
47+
if: github.event_name == 'pull_request'
48+
uses: actions/upload-artifact@v4
49+
with:
50+
path: doc/deploy
51+
52+
deploy:
53+
runs-on: ubuntu-22.04
54+
needs: build
55+
if: github.event_name != 'pull_request'
56+
permissions:
57+
pages: write
58+
id-token: write
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
uses: actions/deploy-pages@v4

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Zephyr Example Application
2+
3+
<a href="https://zephyrproject-rtos.github.io/example-application/doxygen">
4+
<img alt="API Documentation" src="https://img.shields.io/badge/API-documentation-3D578C?logo=c&logoColor=white">
5+
</a>
6+
<a href="https://zephyrproject-rtos.github.io/example-application/sphinx">
7+
<img alt="Documentation" src="https://img.shields.io/badge/documentation-3D578C?logo=sphinx&logoColor=white">
8+
</a>
29

310
This repository contains a Zephyr example application. The main purpose of this
411
repository is to serve as a reference on how to structure Zephyr-based

0 commit comments

Comments
 (0)