From 28cecb2b5acec3430a0ca81059434ce83eec1b22 Mon Sep 17 00:00:00 2001 From: Davide Magrin Date: Sun, 16 Jan 2022 22:03:00 +0100 Subject: [PATCH] Add Github Action to build and deploy docs --- .github/workflows/deploy-docs.yml | 47 +++++++++++++++++++++++++++++++ generate_docs.sh | 11 -------- 2 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/deploy-docs.yml delete mode 100755 generate_docs.sh diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..95eeb2c85a --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,47 @@ +name: Build and deploy docs + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Clone ns-3 + run: git clone https://gitlab.com/nsnam/ns-3-dev + - uses: actions/checkout@v2 + with: + path: 'ns-3-dev/src/lorawan' + - name: Install dependencies needed to generate docs + run: | + sudo apt-get update + sudo apt-get install dia doxygen sphinx-doc sphinx-common python3-pydot texlive-full latexmk dvipng texlive-font-utils + sudo mv /etc/ImageMagick-7/policy.xml /etc/ImageMagick-7/policy.xml.bak + - name: Build docs + run: | + cd ns-3-dev/ + cp utils/.ns3rc ./ + sed -i "s/all_modules/lorawan/" .ns3rc + sed -i "s/False/True/" .ns3rc + ./ns3 configure + ./ns3 docs all + - name: Pushes to another repository + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + with: + source-directory: 'docs/' + destination-github-username: 'signetlabdei' + destination-repository-name: 'lorawan-docs' + user-email: magrin.davide@gmail.com + target-branch: master diff --git a/generate_docs.sh b/generate_docs.sh deleted file mode 100755 index ea82ef1942..0000000000 --- a/generate_docs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -cd ../.. -./waf configure -./waf sphinx -doxygen doc/doxygen.conf -cd lorawan-docs -rsync -rl ../doc/ ./ -git add . -git commit -m "Update API" -git push origin gh-pages