|
15 | 15 | # Allow manual trigger from the GitHub UI |
16 | 16 | workflow_dispatch: |
17 | 17 |
|
| 18 | +# ── Use Node.js 24 for all actions (avoids Node 20 deprecation warnings) ────── |
| 19 | +env: |
| 20 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
| 21 | + |
18 | 22 | # ── Permissions (required for Pages deployment) ─────────────────────────────── |
19 | 23 | permissions: |
20 | 24 | contents: read |
21 | 25 | pages: write |
22 | 26 | id-token: write |
23 | 27 |
|
24 | | -# ── Only one deployment at a time; cancel in-progress runs on new push ──────── |
| 28 | +# ── Only one deployment at a time ───────────────────────────────────────────── |
25 | 29 | concurrency: |
26 | 30 | group: pages |
27 | 31 | cancel-in-progress: true |
@@ -49,28 +53,52 @@ jobs: |
49 | 53 | - name: Install dependencies |
50 | 54 | run: pnpm install --frozen-lockfile |
51 | 55 |
|
52 | | - - name: Configure GitHub Pages |
53 | | - uses: actions/configure-pages@v5 |
54 | | - |
55 | 56 | - name: Build all docs sites |
56 | | - # GITHUB_TOKEN is automatically provided — used to fetch module data |
57 | | - # from the GitHub API without hitting the anonymous rate limit (60 req/hr) |
58 | 57 | env: |
| 58 | + # Provides 5 000 req/hr GitHub API limit for module ecosystem data |
59 | 59 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
60 | 60 | run: pnpm build:all |
61 | 61 |
|
62 | | - # ── Merge both build outputs into one deploy folder ────────────────────── |
63 | | - # Astro builds with base '/xoops-docs/2.7' → output is in dist/xoops-docs/2.7/ |
64 | | - # We strip the leading 'xoops-docs/' so dist-all/ contains just '2.7/' and '4.x/' |
65 | | - # GitHub Pages serves xoops-docs repo at /xoops-docs/, so: |
| 62 | + # ── Debug: show what Astro produced ──────────────────────────────────── |
| 63 | + # Remove this step once the first deploy is confirmed working. |
| 64 | + - name: Show dist structure |
| 65 | + run: | |
| 66 | + echo "=== docs-27/dist ===" |
| 67 | + find apps/docs-27/dist -maxdepth 4 -type f | sort | head -30 |
| 68 | + echo "=== docs-4x/dist ===" |
| 69 | + find apps/docs-4x/dist -maxdepth 4 -type f | sort | head -20 |
| 70 | +
|
| 71 | + # ── Merge both build outputs into one deploy folder ───────────────────── |
| 72 | + # |
| 73 | + # How Astro 6 static output works with base: |
| 74 | + # base: '/xoops-docs/2.7' → files land in dist/xoops-docs/2.7/ |
| 75 | + # base: '/xoops-docs/4.x' → files land in dist/xoops-docs/4.x/ |
| 76 | + # |
| 77 | + # We strip the leading 'xoops-docs/' so dist-all/ contains 2.7/ and 4.x/. |
| 78 | + # GitHub Pages serves the repo at /xoops-docs/, so: |
66 | 79 | # dist-all/2.7/index.html → https://xoops.github.io/xoops-docs/2.7/ |
67 | 80 | # dist-all/4.x/index.html → https://xoops.github.io/xoops-docs/4.x/ |
68 | 81 | - name: Merge build outputs |
69 | 82 | run: | |
70 | 83 | mkdir -p dist-all |
71 | | - # Copy content out of the nested base-path folder |
72 | | - cp -r apps/docs-27/dist/xoops-docs/. dist-all/ |
73 | | - cp -r apps/docs-4x/dist/xoops-docs/. dist-all/ |
| 84 | +
|
| 85 | + # Copy nested base-path content out one level |
| 86 | + if [ -d "apps/docs-27/dist/xoops-docs" ]; then |
| 87 | + cp -r apps/docs-27/dist/xoops-docs/. dist-all/ |
| 88 | + else |
| 89 | + echo "WARNING: docs-27 dist/xoops-docs not found — falling back to flat copy" |
| 90 | + mkdir -p dist-all/2.7 |
| 91 | + cp -r apps/docs-27/dist/. dist-all/2.7/ |
| 92 | + fi |
| 93 | +
|
| 94 | + if [ -d "apps/docs-4x/dist/xoops-docs" ]; then |
| 95 | + cp -r apps/docs-4x/dist/xoops-docs/. dist-all/ |
| 96 | + else |
| 97 | + echo "WARNING: docs-4x dist/xoops-docs not found — falling back to flat copy" |
| 98 | + mkdir -p dist-all/4.x |
| 99 | + cp -r apps/docs-4x/dist/. dist-all/4.x/ |
| 100 | + fi |
| 101 | +
|
74 | 102 | # Root redirect: /xoops-docs/ → /xoops-docs/2.7/ |
75 | 103 | cat > dist-all/index.html << 'EOF' |
76 | 104 | <!DOCTYPE html> |
|
86 | 114 | </html> |
87 | 115 | EOF |
88 | 116 |
|
| 117 | + echo "=== dist-all layout ===" |
| 118 | + find dist-all -maxdepth 3 -type f | sort | head -30 |
| 119 | +
|
89 | 120 | - name: Upload Pages artifact |
90 | 121 | uses: actions/upload-pages-artifact@v3 |
91 | 122 | with: |
|
0 commit comments