Merge pull request #745 from aws-solutions-library-samples/fix/sectio… #320
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 to GitHub Pages | |
| # checkov:skip=CKV2_GHA_1: "Permissions are properly scoped - contents:read, pages:write, id-token:write for GitHub Pages deployment" | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'docs/**' | |
| - 'docs-site/**' | |
| - 'images/**' | |
| workflow_dispatch: # Allow manual trigger | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: docs-site/package-lock.json | |
| - name: Install dependencies | |
| working-directory: docs-site | |
| run: npm ci | |
| - name: Setup symlinks | |
| working-directory: docs-site | |
| # Use setup.sh as the single source of truth so the symlink set (top-level | |
| # docs, docs/extensions/, docs/benchmarking/, and images) can't drift from | |
| # local builds. An inline copy previously missed the extensions/benchmarking | |
| # subfolders and broke the build when sidebar entries referenced them. | |
| run: bash setup.sh | |
| - name: Build documentation site | |
| working-directory: docs-site | |
| run: npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | |
| with: | |
| path: docs-site/dist | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| 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@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |