docs: add development workflow and update deploy-dev to use GitHub Ac… #2
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 Dev Environment | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| inputs: | |
| force_build_all: | |
| description: 'Force build all sites (Portal + all standards)' | |
| required: false | |
| default: 'true' | |
| type: boolean | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages-dev" | |
| cancel-in-progress: false | |
| jobs: | |
| build-portal: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build theme package | |
| run: pnpm build:theme | |
| - name: Build portal | |
| run: pnpm exec docusaurus build portal | |
| env: | |
| BASE_URL: /standards-dev/ | |
| NODE_ENV: production | |
| DOCS_ENV: dev | |
| - name: Upload portal artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: portal-build | |
| path: portal/build | |
| retention-days: 1 | |
| build-standards: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| standard: [ISBDM, LRM, FRBR, isbd, muldicat, unimarc] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build theme package | |
| run: pnpm build:theme | |
| - name: Build ${{ matrix.standard }} | |
| run: pnpm exec docusaurus build standards/${{ matrix.standard }} | |
| env: | |
| BASE_URL: /standards-dev/${{ matrix.standard }}/ | |
| NODE_ENV: production | |
| DOCS_ENV: dev | |
| - name: Upload ${{ matrix.standard }} artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.standard }}-build | |
| path: standards/${{ matrix.standard }}/build | |
| retention-days: 1 | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [build-portal, build-standards] | |
| steps: | |
| - name: Create deployment directory | |
| run: mkdir -p deployment | |
| - name: Download portal build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: portal-build | |
| path: deployment/ | |
| - name: Download ISBDM build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ISBDM-build | |
| path: deployment/ISBDM | |
| - name: Download LRM build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: LRM-build | |
| path: deployment/LRM | |
| - name: Download FRBR build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: FRBR-build | |
| path: deployment/FRBR | |
| - name: Download isbd build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isbd-build | |
| path: deployment/isbd | |
| - name: Download muldicat build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: muldicat-build | |
| path: deployment/muldicat | |
| - name: Download unimarc build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: unimarc-build | |
| path: deployment/unimarc | |
| - name: Create standards index | |
| run: | | |
| cat > deployment/standards.html << 'INDEXEOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>IFLA Standards - Dev Environment</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | |
| max-width: 800px; | |
| margin: 0 auto; | |
| padding: 2rem; | |
| background: #f5f5f5; | |
| } | |
| .container { | |
| background: white; | |
| padding: 2rem; | |
| border-radius: 8px; | |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| } | |
| h1 { | |
| color: #333; | |
| margin-bottom: 0.5rem; | |
| } | |
| .subtitle { | |
| color: #666; | |
| margin-bottom: 2rem; | |
| } | |
| .env-badge { | |
| background: #ff6b35; | |
| color: white; | |
| padding: 0.25rem 0.75rem; | |
| border-radius: 4px; | |
| font-size: 0.8rem; | |
| font-weight: 600; | |
| margin-left: 1rem; | |
| } | |
| ul { | |
| list-style: none; | |
| padding: 0; | |
| } | |
| li { | |
| margin: 1rem 0; | |
| } | |
| a { | |
| display: block; | |
| padding: 1rem; | |
| background: #f8f9fa; | |
| color: #0066cc; | |
| text-decoration: none; | |
| border-radius: 4px; | |
| border: 1px solid #e9ecef; | |
| transition: all 0.2s; | |
| } | |
| a:hover { | |
| background: #e9ecef; | |
| border-color: #dee2e6; | |
| transform: translateX(4px); | |
| } | |
| .standard-name { | |
| font-weight: 600; | |
| display: block; | |
| margin-bottom: 0.25rem; | |
| } | |
| .standard-desc { | |
| font-size: 0.875rem; | |
| color: #666; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>IFLA Standards Documentation <span class="env-badge">DEV</span></h1> | |
| <p class="subtitle">International Federation of Library Associations and Institutions</p> | |
| <ul> | |
| <li> | |
| <a href="./ISBDM/"> | |
| <span class="standard-name">ISBDM</span> | |
| <span class="standard-desc">International Standard Bibliographic Description for Manifestations</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="./LRM/"> | |
| <span class="standard-name">LRM</span> | |
| <span class="standard-desc">Library Reference Model</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="./FRBR/"> | |
| <span class="standard-name">FRBR</span> | |
| <span class="standard-desc">Functional Requirements</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="./isbd/"> | |
| <span class="standard-name">ISBD</span> | |
| <span class="standard-desc">International Standard Bibliographic Description</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="./muldicat/"> | |
| <span class="standard-name">MulDiCat</span> | |
| <span class="standard-desc">Multilingual Dictionary of Cataloguing Terms</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="./unimarc/"> | |
| <span class="standard-name">UNIMARC</span> | |
| <span class="standard-desc">Universal Machine-Readable Cataloguing</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| </body> | |
| </html> | |
| INDEXEOF | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: deployment | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |