Build & Deploy Website #1
This file contains 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: Build & Deploy Website | |
on: | |
workflow_run: | |
workflows: [Algorithm Analysis] | |
types: | |
- completed | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Set up Python | |
id: setup_python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Cache pip | |
uses: actions/cache@v3 | |
id: pip-cache | |
with: | |
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ${{ env.pythonLocation }} | |
if: steps.pip-cache.outputs.cache-hit != 'true' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
# Action Figures artifact | |
- name: 'Download artifact' | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
uses: ./.github/actions/download-artifact | |
with: | |
name: 'Figures' | |
# Action analysis data artifact | |
- name: 'Download analysis data' | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
uses: ./.github/actions/download-artifact | |
with: | |
name: 'Data' | |
- name: move data to the dashboard folder | |
run: | | |
mv test_output.csv website/dashboard | |
- name: Build documentation | |
run: | | |
mkdir docs/_static | |
mv *.pdf docs/_static/ | |
sphinx-apidoc -o docs src | |
cd docs/ | |
make html | |
- name: move data to the website folder | |
run: | | |
mv "docs/_build/html" "website/documentation" | |
- name: Upload docs artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'website' | |
deploy: | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |