From d3a24e485618c77ad20f4d33e82a1dea197abd7c Mon Sep 17 00:00:00 2001 From: msinn Date: Sat, 14 May 2022 16:11:49 +0200 Subject: [PATCH] workflows: Added workflows to build documentation --- .github/workflows/builddevdoc.yml | 68 ++++++++++++++++++++++++++ .github/workflows/buildreleasedoc.yml | 70 +++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100755 .github/workflows/builddevdoc.yml create mode 100755 .github/workflows/buildreleasedoc.yml diff --git a/.github/workflows/builddevdoc.yml b/.github/workflows/builddevdoc.yml new file mode 100755 index 000000000..4a30eca8a --- /dev/null +++ b/.github/workflows/builddevdoc.yml @@ -0,0 +1,68 @@ +name: "Build doc from develop" +#on: [workflow_dispatch, push] +on: + workflow_dispatch: + push: + branches: + - 'develop' +env: + DEP_PATH: smarthomeng/requirements/all.txt +jobs: + build: + runs-on: ubuntu-20.04 #latest + strategy: + fail-fast: false + matrix: + python-version: [ '3.8' ] + name: Python ${{ matrix.python-version }} + steps: + - name: update OS (Ubuntu) + run: sudo apt-get update + - run: sudo apt-get install libudev-dev + - run: sudo apt-get install librrd-dev libpython3-dev + - run: sudo apt-get install gcc --only-upgrade + - uses: actions/checkout@v2 + - name: Checkout SmartHomeNG DEVELOP Branch + uses: actions/checkout@v2 + with: + repository: smarthomeNG/smarthome + ref: develop + path: smarthomeng + - name: Checkout SmartHomeNG/plugins DEVELOP Branch + uses: actions/checkout@v2 + with: + repository: smarthomeNG/plugins + ref: develop + path: smarthomeng/plugins + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Print Python Version + run: python --version + - run: python3 -m pip install --upgrade pip #==19.3.1 + #- run: pip install tox-travis virtualenv>=20.0.8 --upgrade + #- run: pip install sphinx sphinx_rtd_theme recommonmark ruamel.yaml pytest + - name: Install requirements for documentation build + run: pip install -r smarthomeng/doc/requirements.txt + - name: List installed packages + run: pip list + + - name: Build documentation + working-directory: ./smarthomeng/doc + run: bash ./build_doc_local.sh + + #- name: Deploy documentation + # uses: JamesIves/github-pages-deploy-action@v4.3.3 + # with: + # branch: develop_doc # The branch the action should deploy to. + # folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy. + + - name: Deploy documentation to seperate repo dev_doc + uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy. + repository-name: 'smarthomeNG/dev_doc' + token: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/buildreleasedoc.yml b/.github/workflows/buildreleasedoc.yml new file mode 100755 index 000000000..fc08826ac --- /dev/null +++ b/.github/workflows/buildreleasedoc.yml @@ -0,0 +1,70 @@ +name: "Build doc from master" +#on: [workflow_dispatch, push] +on: + workflow_dispatch: + push: + branches: + - 'master' +env: + DEP_PATH: smarthomeng/requirements/all.txt +jobs: + build: + runs-on: ubuntu-20.04 #latest + strategy: + fail-fast: false + matrix: + python-version: [ '3.8' ] + name: Python ${{ matrix.python-version }} + steps: + - name: update OS (Ubuntu) + run: sudo apt-get update + - run: sudo apt-get install libudev-dev + - run: sudo apt-get install librrd-dev libpython3-dev + - run: sudo apt-get install gcc --only-upgrade + - uses: actions/checkout@v2 + - name: Checkout SmartHomeNG DEVELOP Branch + uses: actions/checkout@v2 + with: + repository: smarthomeNG/smarthome + ref: master + path: smarthomeng + - name: Checkout SmartHomeNG/plugins DEVELOP Branch + uses: actions/checkout@v2 + with: + repository: smarthomeNG/plugins + ref: master + path: smarthomeng/plugins + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Print Python Version + run: python --version + - run: python3 -m pip install --upgrade pip #==19.3.1 + #- run: pip install tox-travis virtualenv>=20.0.8 --upgrade + + - name: Install requirements for documentation build + run: pip install -r smarthomeng/doc/requirements.txt + - run: pip install attrs # install seperatly until requirements in master branch are updated + + - name: List installed packages + run: pip list + + - name: Build documentation + working-directory: ./smarthomeng/doc + run: bash ./build_doc_local.sh + + #- name: Deploy documentation + # uses: JamesIves/github-pages-deploy-action@v4.3.3 + # with: + # branch: release_doc # The branch the action should deploy to. + # folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy. + + - name: Deploy documentation to seperate repo dev_doc + uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: release_doc # The branch the action should deploy to. + folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy. + repository-name: 'smarthomeNG/smarthome' + token: ${{ secrets.PAT_TOKEN }}