diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6589a4902..6899b31c1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -8,10 +8,9 @@ on: branches: - main - jobs: docs_build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -37,22 +36,43 @@ jobs: - name: Upload HTML Documentation uses: actions/upload-artifact@v2.2.4 with: - name: Documentation + name: HTML-Documentation path: doc/build/html retention-days: 7 - name: Upload PDF Documentation uses: actions/upload-artifact@v2.2.4 with: - name: Documentation + name: PDF-Documentation path: doc/build/latex/*.pdf retention-days: 7 + Release: + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: docs_build + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - uses: actions/download-artifact@v2 + + - name: Display structure of downloaded files + run: ls -R + - name: Deploy to gh-pages uses: JamesIves/github-pages-deploy-action@4.1.5 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: doc/build/html - CLEAN: true + token: ${{ secrets.github_token }} + branch: gh-pages + folder: doc/build/html + clean: true single-commit: true + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + ./**/*.pdf diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml new file mode 100644 index 000000000..1cfeab2fa --- /dev/null +++ b/.github/workflows/nightly-build.yml @@ -0,0 +1,55 @@ +name: Nightly Documentation Build + + +on: + schedule: # UTC at 0400 + - cron: '0 4 * * */2' # To run every 3 days + workflow_dispatch: + +jobs: + nightly_docs_build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2.2.2 + with: + python-version: 3.8 + + - name: Build HTML Documentation + run: | + pip install -r requirements_docs.txt --disable-pip-version-check + make -C doc html SPHINXOPTS="-W" + touch doc/build/html/.nojekyll + echo "dev.docs.pyansys.com" > doc/build/html/CNAME + + - name: Build PDF Documentation + run: | + sudo apt update + sudo apt-get install -y texlive-latex-extra latexmk + make -C doc latexpdf + + - name: Upload HTML Documentation + uses: actions/upload-artifact@v2.2.4 + with: + name: HTML-Documentation + path: doc/build/html + retention-days: 7 + + - name: Upload PDF Documentation + uses: actions/upload-artifact@v2.2.4 + with: + name: PDF-Documentation + path: doc/build/latex/*.pdf + retention-days: 7 + + - name: Deploy to gh-pages + uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + token: ${{ secrets.github_token }} + branch: gh-pages + folder: doc/build/html + clean: true + single-commit: true