ci: update documentation build process to include stable and developm… #11
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: Deploy Documentation | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install mkdocs mkdocs-material jq | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Build documentation | |
| run: | | |
| # Create directories and copy docs | |
| mkdir -p docs/{guide,downloads} | |
| cp README.md docs/index.md || echo "# NetworkMonitor" > docs/index.md | |
| cp DEVELOPER.md docs/guide/developer.md || echo "# Developer Guide" > docs/guide/developer.md | |
| # Get current artifacts naming from CI workflow | |
| REPO="${{ github.repository }}" | |
| BASE_URL="https://github.com/${REPO}/releases/latest/download" | |
| cat > docs/downloads/index.md << EOL | |
| # Downloads | |
| ## Latest Release | |
| ### Download Stable Release | |
| Latest stable builds from our releases: | |
| #### Windows | |
| - [Windows Installer (64-bit)](${BASE_URL}/Windows-artifacts.zip) | |
| #### Linux | |
| - [Linux Build](${BASE_URL}/Linux-artifacts.zip) | |
| #### macOS | |
| - [macOS Build](${BASE_URL}/macOS-artifacts.zip) | |
| ### Development Builds | |
| You can also get the latest development builds directly from our CI: | |
| 1. Go to [Actions](https://github.com/${REPO}/actions/workflows/ci.yml) | |
| 2. Click on the latest successful workflow run | |
| 3. Scroll down to "Artifacts" | |
| 4. Download the appropriate artifact for your platform: | |
| - \`Windows-artifacts.zip\` for Windows | |
| - \`Linux-artifacts.zip\` for Linux | |
| - \`macOS-artifacts.zip\` for macOS | |
| ## System Requirements | |
| ### Windows | |
| - Windows 10 or later (64-bit) | |
| - [Npcap](https://npcap.com) installed in WinPcap compatibility mode | |
| ### Linux | |
| - Modern Linux distribution (Ubuntu 20.04+, Debian 11+, etc.) | |
| - libpcap installed (\`sudo apt install libpcap-dev\` or equivalent) | |
| - Root/sudo privileges for packet capture | |
| ### macOS | |
| - macOS 10.15 (Catalina) or later | |
| - libpcap installed (pre-installed or via \`brew install libpcap\`) | |
| - Root privileges for packet capture | |
| EOL | |
| # Create mkdocs config | |
| cat > mkdocs.yml << EOL | |
| site_name: NetworkMonitor | |
| site_description: Network monitoring and analysis tool | |
| repo_url: https://github.com/${{ github.repository }} | |
| edit_uri: edit/main/docs/ | |
| theme: | |
| name: material | |
| palette: | |
| scheme: slate | |
| primary: blue | |
| accent: light blue | |
| features: | |
| - navigation.instant | |
| - navigation.tracking | |
| - navigation.sections | |
| - navigation.expand | |
| - navigation.top | |
| - toc.follow | |
| - search.suggest | |
| - search.highlight | |
| nav: | |
| - Home: index.md | |
| - Downloads: downloads/index.md | |
| - Documentation: | |
| - Developer Guide: guide/developer.md | |
| markdown_extensions: | |
| - pymdownx.highlight: | |
| anchor_linenums: true | |
| - pymdownx.inlinehilite | |
| - pymdownx.snippets | |
| - pymdownx.superfences | |
| - admonition | |
| - footnotes | |
| - attr_list | |
| - md_in_html | |
| EOL | |
| mkdocs build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |