👷 CI: Add CI steps to create streamlit example branch and deploy EMP … #114
Workflow file for this run
This file contains hidden or 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
| name: Test documentation building, and publish report to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' # caching pip dependencies | |
| cache-dependency-path: '**/pyproject.toml' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[docs] | |
| - name: Build references | |
| run: | | |
| cd docs | |
| sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| sphinx-build -n --keep-going -b html ./ ./_build/ | |
| # --- HTML example deployment --- | |
| - name: Rename entry point of report to index.html | |
| run: | | |
| mv docs/quarto_report/quarto_report.html docs/quarto_report/index.html | |
| - name: Publish html report to github pages | |
| # Only publish a new static report upon a new release -> can be changed. | |
| if: startsWith(github.ref, 'refs/tags') | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/quarto_report/ | |
| # - name: save artifacts | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: Sphinx_${{ matrix.python-version }} | |
| # path: docs/_build/ | |
| # --- Streamlit example deployment --- | |
| - name: Configure Git for Streamlit example branch | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Create or reset Streamlit example branch | |
| run: | | |
| git fetch origin | |
| git checkout -B streamlit-example | |
| - name: Remove all existing files except .git | |
| run: | | |
| find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} + | |
| - name: Copy necessary Streamlit files | |
| run: | | |
| git checkout main -- docs/streamlit_report docs/example_data/Earth_microbiome_vuegen_demo_notebook requirements.txt | |
| - name: Commit and push to streamlit-example branch | |
| run: | | |
| git add . | |
| git commit -m "Update Streamlit example deployment files" | |
| git push --force origin streamlit-example |