fireq-component-docs-updated #110
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: Build and deploy FIREQ documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - docs/** | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: | |
| - fireq-component-docs-updated | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: fireq-docs-pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout FIREQ-docs | |
| uses: actions/checkout@v4 | |
| with: | |
| path: FIREQ-docs | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install documentation dependencies | |
| working-directory: FIREQ-docs | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Read integrated release manifest | |
| id: release | |
| working-directory: FIREQ-docs | |
| run: | | |
| python - <<'PY' >> "$GITHUB_OUTPUT" | |
| import yaml | |
| with open("fireq-release.yaml", "r", encoding="utf-8") as f: | |
| data = yaml.safe_load(f) | |
| print(f"fireq_release={data['fireq_release']}") | |
| print(f"client_repo={data['repositories']['client']['repository']}") | |
| print(f"client_ref={data['repositories']['client']['ref']}") | |
| print(f"firmware_repo={data['repositories']['firmware']['repository']}") | |
| print(f"firmware_ref={data['repositories']['firmware']['ref']}") | |
| print(f"server_repo={data['repositories']['server']['repository']}") | |
| print(f"server_ref={data['repositories']['server']['ref']}") | |
| PY | |
| - name: Show integrated release | |
| run: | | |
| echo "FIREQ release: ${{ steps.release.outputs.fireq_release }}" | |
| echo "Client: ${{ steps.release.outputs.client_repo }} @ ${{ steps.release.outputs.client_ref }}" | |
| echo "Firmware: ${{ steps.release.outputs.firmware_repo }} @ ${{ steps.release.outputs.firmware_ref }}" | |
| echo "Server: ${{ steps.release.outputs.server_repo }} @ ${{ steps.release.outputs.server_ref }}" | |
| - name: Checkout FIREQ-Client | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ steps.release.outputs.client_repo }} | |
| ref: ${{ steps.release.outputs.client_ref }} | |
| path: FIREQ-Client | |
| token: ${{ secrets.FIREQ_DOCS_PAT }} | |
| - name: Checkout FIREQ firmware | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ steps.release.outputs.firmware_repo }} | |
| ref: ${{ steps.release.outputs.firmware_ref }} | |
| path: FIREQ | |
| token: ${{ secrets.FIREQ_DOCS_PAT }} | |
| - name: Checkout FIREQ-Server | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ steps.release.outputs.server_repo }} | |
| ref: ${{ steps.release.outputs.server_ref }} | |
| path: FIREQ-Server | |
| token: ${{ secrets.FIREQ_DOCS_PAT }} | |
| - name: Synchronize component documentation | |
| working-directory: FIREQ-docs | |
| run: | | |
| ./scripts/sync_component_docs.sh | |
| - name: Build Sphinx documentation | |
| working-directory: FIREQ-docs | |
| run: | | |
| python -m sphinx -b html docs _build/html | |
| - name: Upload documentation preview artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fireq-docs-html-preview | |
| path: FIREQ-docs/_build/html | |
| if-no-files-found: error | |
| - name: Configure GitHub Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload GitHub Pages artifact | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: FIREQ-docs/_build/html | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |