-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: MPhalke <[email protected]>
- Loading branch information
Showing
2 changed files
with
2,727 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Documentation | ||
name: documentation | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
|
@@ -10,21 +10,82 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install sphinx-toolbox | ||
pip install sphinx sphinx_rtd_theme myst_parser | ||
sudo apt-get install doxygen graphviz -y | ||
- name: Sphinx build | ||
run: | | ||
sphinx-build doc/sphinx _build | ||
pushd doc/sphinx | ||
sphinx-build ./ ./build | ||
popd | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/ | ||
force_orphan: true | ||
- name: Doxygen build | ||
run: | | ||
pushd doc/doxygen | ||
doxygen Doxyfile | ||
popd | ||
- name: Update gh pages | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CSE-CI" | ||
MASTER_COMMIT=$(git rev-parse --short HEAD) | ||
REPO_SLUG="${REPO_SLUG:-analogdevicesinc/precision-converters-firmware}" | ||
git fetch --depth 1 origin +refs/heads/gh-pages:gh-pages | ||
git checkout gh-pages | ||
# Clear previous content in the root folder except the doc path which holds new builds | ||
find -mindepth 1 -maxdepth 1 ! \( -name "doc" -o -name ".git" \) -exec rm -r {} \; | ||
# Create doxygen folder holding new build content | ||
mkdir -p doxygen | ||
cp -R doc/doxygen/html/* doxygen/ | ||
# Add sphinx build content to root folder | ||
cp -R doc/sphinx/build/* ./ | ||
rm -rf doc | ||
# Create .nojekyll file | ||
touch nojekyll | ||
CURRENT_COMMIT=$(git log -1 --pretty=%B) | ||
if [[ ${CURRENT_COMMIT:(-7)} != ${MASTER_COMMIT:0:7} ]] | ||
then | ||
git add --all . | ||
git commit --allow-empty --amend -m "Update documentation to ${MASTER_COMMIT:0:7}" | ||
if [ -n "$GITHUB_DOC_TOKEN" ] ; then | ||
git push https://${GITHUB_DOC_TOKEN}@github.com/${REPO_SLUG} gh-pages -f | ||
else | ||
git push origin gh-pages -f | ||
fi | ||
# echo_green "Documetation updated!" | ||
else | ||
# echo_green "Documentation already up to date!" | ||
fi | ||
# - name: Deploy doxygen to GitHub Pages | ||
# uses: DenverCoder1/[email protected] | ||
# with: | ||
# branch: gh-pages | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# folder: doxygen | ||
# config_file: doc/doxygen/Doxyfile | ||
|
||
# - name: Deploy sphinx to GitHub Pages | ||
# uses: peaceiris/actions-gh-pages@v3 | ||
# with: | ||
# publish_branch: gh-pages | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# publish_dir: _build/ | ||
# force_orphan: true |
Oops, something went wrong.