2021-04-23 17:45:34 -04:00
|
|
|
name: Build docs
|
2021-04-24 20:55:00 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-10 14:59:32 -04:00
|
|
|
- 'release/*'
|
2021-05-04 16:46:44 -04:00
|
|
|
env:
|
|
|
|
EM_VERSION: 2.0.4
|
|
|
|
EM_CACHE_FOLDER: 'emsdk-cache'
|
2021-04-23 17:45:34 -04:00
|
|
|
jobs:
|
|
|
|
build-and-deploy:
|
2021-04-28 08:40:38 -04:00
|
|
|
if: github.repository == 'lvgl/lvgl'
|
2021-04-23 17:45:34 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-08 20:34:16 -04:00
|
|
|
concurrency: docs-build-and-deploy
|
2021-04-23 17:45:34 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-11-02 11:03:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2021-04-23 17:45:34 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Python
|
2023-04-27 19:54:05 +02:00
|
|
|
uses: actions/setup-python@v4
|
2021-04-23 17:45:34 -04:00
|
|
|
with:
|
2023-04-27 19:54:05 +02:00
|
|
|
python-version: '3.10'
|
2021-05-04 16:46:44 -04:00
|
|
|
- name: Cache Python packages
|
2023-11-02 11:03:05 +01:00
|
|
|
uses: actions/cache@v3
|
2021-05-04 16:46:44 -04:00
|
|
|
with:
|
|
|
|
# Cache the Python package environment, excluding pip and setuptools installed by setup-python
|
|
|
|
path: |
|
|
|
|
~/.cache/pip
|
|
|
|
${{ env.pythonLocation }}/bin/*
|
|
|
|
${{ env.pythonLocation }}/include
|
|
|
|
${{ env.pythonLocation }}/lib/python*/site-packages/*
|
|
|
|
!${{ env.pythonLocation }}/bin/pip*
|
|
|
|
!${{ env.pythonLocation }}/lib/python*/site-packages/pip*
|
|
|
|
!${{ env.pythonLocation }}/lib/python*/site-packages/setuptools*
|
2021-05-15 16:08:55 -04:00
|
|
|
key: ${{ env.pythonLocation }}-${{ hashFiles('docs/requirements.txt') }}
|
2021-05-04 20:49:13 -04:00
|
|
|
- name: Install Doxygen and Latex dependencies
|
2021-09-12 08:11:37 -04:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install doxygen texlive-xetex texlive-binaries texlive-lang-english latexmk fonts-freefont-otf
|
2021-04-23 17:45:34 -04:00
|
|
|
- name: Install requirements
|
|
|
|
run: |
|
2021-05-14 20:25:40 -04:00
|
|
|
pip install -r docs/requirements.txt
|
2021-05-04 16:46:44 -04:00
|
|
|
- name: Setup Emscripten cache
|
|
|
|
id: cache-system-libraries
|
2023-11-02 11:03:05 +01:00
|
|
|
uses: actions/cache@v3
|
2021-05-04 16:46:44 -04:00
|
|
|
with:
|
|
|
|
path: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
key: ${{env.EM_VERSION}}-${{ runner.os }}
|
2023-12-02 12:48:14 +01:00
|
|
|
- uses: mymindstorm/setup-emsdk@v13
|
2021-05-04 16:46:44 -04:00
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
2021-05-07 12:40:58 -04:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
- name: Build examples (with cache)
|
2021-05-04 16:41:56 -04:00
|
|
|
run: scripts/build_html_examples.sh
|
2021-04-23 17:45:34 -04:00
|
|
|
- name: Build docs
|
2023-04-29 06:23:31 +02:00
|
|
|
run: docs/build.py skip_latex
|
2021-04-28 08:40:38 -04:00
|
|
|
- name: Remove .doctrees
|
|
|
|
run: rm -rf out_html/.doctrees
|
2021-04-23 17:45:34 -04:00
|
|
|
- name: Retrieve version
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=VERSION_NAME::$(scripts/find_version.sh)"
|
|
|
|
id: version
|
2021-06-07 13:09:16 -04:00
|
|
|
- name: Deploy to subfolder
|
2023-12-02 12:48:38 +01:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
2021-04-23 17:45:34 -04:00
|
|
|
with:
|
2023-10-26 19:42:07 +02:00
|
|
|
token: ${{ secrets.LVGL_BOT_TOKEN }}
|
|
|
|
repository-name: lvgl/docs
|
|
|
|
branch: gh-pages # The branch the action should deploy to.
|
|
|
|
folder: out_html # The folder the action should deploy.
|
|
|
|
target-folder: ${{ steps.version.outputs.VERSION_NAME }}
|
|
|
|
git-config-name: lvgl-bot
|
|
|
|
git-config-email: lvgl-bot@users.noreply.github.com
|
|
|
|
single-commit: true
|
2021-06-07 13:09:16 -04:00
|
|
|
- name: Deploy to master
|
|
|
|
if: github.ref == 'refs/heads/master'
|
2023-12-02 12:48:38 +01:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
2021-06-07 13:09:16 -04:00
|
|
|
with:
|
2023-10-26 19:42:07 +02:00
|
|
|
token: ${{ secrets.LVGL_BOT_TOKEN }}
|
|
|
|
repository-name: lvgl/docs
|
|
|
|
branch: gh-pages # The branch the action should deploy to.
|
|
|
|
folder: out_html # The folder the action should deploy.
|
|
|
|
target-folder: master
|
|
|
|
git-config-name: lvgl-bot
|
2023-12-03 21:17:19 +01:00
|
|
|
git-config-email: lvgl-bot@users.noreply.github.com
|
2023-10-26 19:42:07 +02:00
|
|
|
commit: true
|