Skip to content

Commit 35c076c

Browse files
authored
Merge pull request #2 from mambax7/master
fix: correct Astro base paths, sidebar, workflow, and content structure
2 parents 9df40cb + ab074bc commit 35c076c

37 files changed

Lines changed: 1253 additions & 351 deletions

.github/workflows/deploy.yml

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
name: Deploy Documentation
22

3+
# ── Triggers ──────────────────────────────────────────────────────────────────
34
on:
45
push:
56
branches: [master]
6-
pull_request:
7-
branches: [master]
7+
paths:
8+
- 'apps/**'
9+
- 'packages/**'
10+
- 'pnpm-workspace.yaml'
11+
- '.github/workflows/deploy.yml'
12+
# Rebuild every Monday 08:00 UTC to refresh GitHub module data
13+
schedule:
14+
- cron: '0 8 * * 1'
15+
# Allow manual trigger from the GitHub UI
16+
workflow_dispatch:
17+
18+
# ── Permissions (required for Pages deployment) ───────────────────────────────
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
823

24+
# ── Only one deployment at a time; cancel in-progress runs on new push ────────
25+
concurrency:
26+
group: pages
27+
cancel-in-progress: true
28+
29+
# ── Jobs ──────────────────────────────────────────────────────────────────────
930
jobs:
1031
build:
1132
name: Build Docs
1233
runs-on: ubuntu-latest
1334
steps:
14-
- name: Checkout
35+
- name: Checkout repository
1536
uses: actions/checkout@v4
1637

1738
- name: Setup pnpm
@@ -28,17 +49,44 @@ jobs:
2849
- name: Install dependencies
2950
run: pnpm install --frozen-lockfile
3051

31-
- name: Build all docs
52+
- name: Configure GitHub Pages
53+
uses: actions/configure-pages@v5
54+
55+
- 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+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3260
run: pnpm build:all
3361

34-
# Merge both build outputs into one deploy folder
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:
66+
# dist-all/2.7/index.html → https://xoops.github.io/xoops-docs/2.7/
67+
# dist-all/4.x/index.html → https://xoops.github.io/xoops-docs/4.x/
3568
- name: Merge build outputs
3669
run: |
3770
mkdir -p dist-all
38-
cp -r apps/docs-27/dist/* dist-all/
39-
cp -r apps/docs-4x/dist/* 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/
74+
# Root redirect: /xoops-docs/ → /xoops-docs/2.7/
75+
cat > dist-all/index.html << 'EOF'
76+
<!DOCTYPE html>
77+
<html lang="en">
78+
<head>
79+
<meta charset="utf-8" />
80+
<meta http-equiv="refresh" content="0; url=/xoops-docs/2.7/" />
81+
<title>XOOPS Docs</title>
82+
</head>
83+
<body>
84+
Redirecting to <a href="/xoops-docs/2.7/">XOOPS 2.7 Docs</a>&hellip;
85+
</body>
86+
</html>
87+
EOF
4088
41-
- name: Upload artifact
89+
- name: Upload Pages artifact
4290
uses: actions/upload-pages-artifact@v3
4391
with:
4492
path: dist-all/
@@ -47,11 +95,6 @@ jobs:
4795
name: Deploy to GitHub Pages
4896
needs: build
4997
runs-on: ubuntu-latest
50-
# Only deploy on push to master, not on PRs
51-
if: github.event_name == 'push'
52-
permissions:
53-
pages: write
54-
id-token: write
5598
environment:
5699
name: github-pages
57100
url: ${{ steps.deployment.outputs.page_url }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
.astro/
44
*.local
55
.env
6+
.env.local

.idea/.gitignore

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/mamba.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 176 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php-inspections-ea-ultimate.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)