| 1 | name: Deploy docs to Pages |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: ["main"] |
| 6 | |
| 7 | # Allows you to run this workflow manually from the Actions tab |
| 8 | workflow_dispatch: |
| 9 | |
| 10 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 11 | permissions: |
| 12 | contents: read |
| 13 | pages: write |
| 14 | id-token: write |
| 15 | |
| 16 | # Allow one concurrent deployment |
| 17 | concurrency: |
| 18 | group: "pages" |
| 19 | cancel-in-progress: true |
| 20 | |
| 21 | jobs: |
| 22 | # Single deploy job since we're just deploying |
| 23 | build: |
| 24 | environment: |
| 25 | name: github-pages |
| 26 | url: ${{ steps.deployment.outputs.page_url }} |
| 27 | runs-on: buildjet-8vcpu-ubuntu-2204 |
| 28 | steps: |
| 29 | - name: Checkout |
| 30 | uses: actions/checkout@v4 |
| 31 | - name: Install dependecies needed for ubuntu |
| 32 | run: | |
| 33 | sudo apt install -y protobuf-compiler libssl-dev |
| 34 | rustup update && rustup default |
| 35 | - name: Set up Python |
| 36 | uses: actions/setup-python@v5 |
| 37 | with: |
| 38 | python-version: "3.10" |
| 39 | cache: "pip" |
| 40 | cache-dependency-path: "docs/requirements.txt" |
| 41 | - name: Build Python |
| 42 | working-directory: python |
| 43 | run: | |
| 44 | python -m pip install -e . |
| 45 | python -m pip install -r ../docs/requirements.txt |
| 46 | - name: Set up node |
| 47 | uses: actions/setup-node@v3 |
| 48 | with: |
| 49 | node-version: 20 |
| 50 | cache: 'npm' |
| 51 | cache-dependency-path: node/package-lock.json |
| 52 | - uses: Swatinem/rust-cache@v2 |
| 53 | - name: Install node dependencies |
| 54 | working-directory: node |
| 55 | run: | |
| 56 | sudo apt update |
| 57 | sudo apt install -y protobuf-compiler libssl-dev |
| 58 | - name: Build node |
| 59 | working-directory: node |
| 60 | run: | |
| 61 | npm ci |
| 62 | npm run build |
| 63 | npm run tsc |
| 64 | - name: Create markdown files |
| 65 | working-directory: node |
| 66 | run: | |
| 67 | npx typedoc --plugin typedoc-plugin-markdown --out ../docs/src/javascript src/index.ts |
| 68 | - name: Build docs |
| 69 | working-directory: docs |
| 70 | run: | |
| 71 | PYTHONPATH=. mkdocs build |
| 72 | - name: Setup Pages |
| 73 | uses: actions/configure-pages@v2 |
| 74 | - name: Upload artifact |
| 75 | uses: actions/upload-pages-artifact@v1 |
| 76 | with: |
| 77 | path: "docs/site" |
| 78 | - name: Deploy to GitHub Pages |
| 79 | id: deployment |
| 80 | uses: actions/deploy-pages@v1 |