feat: Enhance Structurizr workflow with diagnostics and improved expo… #5
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 Structurizr to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'architecture/**' | |
| - '.github/templates/architecture-index.html' | |
| - '.github/scripts/build-architecture-site.sh' | |
| - '.github/workflows/structurizr-pages.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pandoc | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq pandoc | |
| - name: Diagnostic — show inputs | |
| run: | | |
| echo "=== architecture/ contents ===" | |
| ls -la architecture/ | |
| echo "=== workspace.dsl head ===" | |
| head -10 architecture/workspace.dsl | |
| echo "=== docker info ===" | |
| docker --version | |
| - name: Pull Structurizr CLI image | |
| run: docker pull structurizr/cli:latest | |
| - name: Show CLI help (sanity check) | |
| run: | | |
| docker run --rm structurizr/cli:latest help export || true | |
| - name: Export Structurizr views as Mermaid | |
| run: | | |
| set -x | |
| docker run --rm \ | |
| -v "${{ github.workspace }}/architecture:/usr/local/structurizr" \ | |
| -u "$(id -u):$(id -g)" \ | |
| structurizr/cli:latest export \ | |
| -workspace /usr/local/structurizr/workspace.dsl \ | |
| -format mermaid \ | |
| -output /usr/local/structurizr 2>&1 | |
| echo "=== Docker exit code: $? ===" | |
| - name: Verify Mermaid export | |
| run: | | |
| echo "=== architecture/ AFTER export ===" | |
| ls -la architecture/ | |
| if ! ls architecture/*.mmd > /dev/null 2>&1; then | |
| echo "ERROR: structurizr/cli did not produce any .mmd files." | |
| echo "Check the export step output above for parser errors." | |
| exit 1 | |
| fi | |
| echo "Mermaid files produced:" | |
| ls -la architecture/*.mmd | |
| - name: Build static site | |
| run: bash .github/scripts/build-architecture-site.sh | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |