Update source docs structure #52
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 MkDocs to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - site | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [specs-updated, modules-updated] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout site branch | |
| uses: actions/checkout@v4 | |
| - name: Checkout master branch content | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| path: master-content | |
| - name: Checkout specs | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microrack/specs | |
| ref: master | |
| path: specs-repo | |
| - name: Checkout modules | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microrack/modules | |
| ref: master | |
| path: modules-repo | |
| - name: Copy local content from master | |
| run: | | |
| # Copy README.md as index page | |
| cp master-content/README.md docs/index.md | |
| echo "Copied README.md -> docs/index.md" | |
| # Copy ecosystem folder | |
| rm -rf docs/ecosystem | |
| cp -r master-content/ecosystem docs/ | |
| echo "Copied ecosystem/" | |
| # Copy setup folder | |
| rm -rf docs/setup | |
| cp -r master-content/setup docs/ | |
| echo "Copied setup/" | |
| # Clean up | |
| rm -rf master-content | |
| echo "=== Copied local content ===" | |
| ls -la docs/ | |
| - name: Copy specs content | |
| run: | | |
| mkdir -p docs/specification | |
| # Copy specs README.md as index | |
| cp specs-repo/README.md docs/specification/index.md | |
| echo "Copied specs README.md -> docs/specification/index.md" | |
| # Copy mechanical folder (README.md + images) | |
| mkdir -p docs/specification/mechanical | |
| cp -r specs-repo/mechanical/* docs/specification/mechanical/ | |
| echo "Copied mechanical/" | |
| # Copy electrical folder (README.md + images) | |
| mkdir -p docs/specification/electrical | |
| cp -r specs-repo/electrical/* docs/specification/electrical/ | |
| echo "Copied electrical/" | |
| # Clean up | |
| rm -rf specs-repo | |
| echo "=== Copied specification files ===" | |
| ls -laR docs/specification/ | |
| - name: Copy modules content | |
| run: | | |
| mkdir -p docs/modules | |
| # Copy modules README.md as index | |
| cp modules-repo/README.md docs/modules/index.md | |
| echo "Copied modules README.md -> docs/modules/index.md" | |
| # Copy each module directory with all its contents (README.md + images) | |
| for dir in modules-repo/mod-*/; do | |
| module=$(basename "$dir") | |
| mkdir -p "docs/modules/${module}" | |
| cp -r "$dir"/* "docs/modules/${module}/" | |
| echo "Copied ${module}/" | |
| done | |
| # Clean up | |
| rm -rf modules-repo | |
| echo "=== Copied module files ===" | |
| ls -la docs/modules/ | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install mkdocs-material mkdocs-minify-plugin pyyaml | |
| - name: Update navigation | |
| run: | | |
| python scripts/update_sections_nav.py | |
| python scripts/update_nav.py | |
| - name: Build site | |
| run: 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 |