Skip to content

Commit e093f90

Browse files
author
Mineplex
committed
Sync from internal repo: 2025-01-20 22:16:12
1 parent cc111b6 commit e093f90

File tree

5 files changed

+222
-35
lines changed

5 files changed

+222
-35
lines changed

.github/workflows/ci.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Documents Search CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20' # Updated to Node.js 20 as per the GitHub Actions change
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Compile TypeScript
28+
run: npx tsc --project tsconfig.scripts.json
29+
30+
- name: Rename .js files to .mjs
31+
run: |
32+
for file in dist/scripts/**/*.js; do
33+
mv "$file" "${file%.js}.mjs"
34+
done
35+
36+
- name: Post-process scripts
37+
run: |
38+
for file in dist/scripts/scripts/content.mjs dist/scripts/lib/pageroutes.mjs; do
39+
if [ -f "$file" ]; then
40+
echo "Processing $file..."
41+
sed -i 's|import { Documents } from '\''@/settings/documents'\''|import { Documents } from '\''../settings/documents.mjs'\''|g' "$file"
42+
if [ $? -ne 0 ]; then
43+
echo "Error: Failed to update $file"
44+
exit 1
45+
fi
46+
echo "$file updated successfully."
47+
else
48+
echo "$file not found!"
49+
fi
50+
done
51+
52+
- name: Run content script
53+
run: node dist/scripts/scripts/content.mjs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish to Public Repo
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
GIT_USER_NAME: Mineplex
11+
GIT_USER_EMAIL: [email protected]
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout private repository code
23+
uses: actions/checkout@v4
24+
with:
25+
path: 'source'
26+
token: ${{ secrets.GH_ACCESS_TOKEN }}
27+
fetch-depth: 0
28+
29+
- name: Set up Git user
30+
run: |
31+
git config --global user.name "${{ env.GIT_USER_NAME }}"
32+
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
33+
34+
- name: Clone public repository
35+
run: |
36+
git clone https://github.com/Mineplex-LLC/Studio-PublicDocs.git public
37+
cd public
38+
git fetch --all
39+
git pull origin master
40+
cd ..
41+
42+
- name: Sync private to public
43+
run: |
44+
rsync -av --exclude '.git' source/ public/
45+
cd public
46+
git add .
47+
if [ -n "$(git status --porcelain)" ]; then
48+
git commit -m "Sync from internal repo: $(date -u +'%Y-%m-%d %H:%M:%S')"
49+
else
50+
echo "No changes to commit"
51+
fi
52+
53+
- name: Push to Public Repo
54+
run: |
55+
cd public
56+
git remote set-url origin https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/Mineplex-LLC/Studio-PublicDocs.git
57+
git push origin master
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Sync from Public Repo
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' # Runs daily at midnight UTC
7+
8+
env:
9+
GIT_USER_NAME: Mineplex
10+
GIT_USER_EMAIL: [email protected]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
sync:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout private repository code
22+
uses: actions/checkout@v4
23+
with:
24+
path: 'private'
25+
token: ${{ secrets.GH_ACCESS_TOKEN }}
26+
fetch-depth: 0
27+
28+
- name: Clone public repository
29+
run: |
30+
git clone https://github.com/Mineplex-LLC/Studio-PublicDocs.git public
31+
cd public
32+
git fetch --all
33+
git pull origin master
34+
cd ..
35+
36+
- name: Set up Git user
37+
run: |
38+
git config --global user.name "${{ env.GIT_USER_NAME }}"
39+
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
40+
41+
- name: Sync public to private
42+
run: |
43+
rsync -av --exclude '.git' public/ private/
44+
cd private
45+
git add .
46+
if [ -n "$(git status --porcelain)" ]; then
47+
git commit -m "Sync from public repo: $(date -u +'%Y-%m-%d %H:%M:%S')"
48+
else
49+
echo "No changes to commit"
50+
fi
51+
52+
- name: Push to Private Repo
53+
run: |
54+
cd private
55+
git pull --rebase
56+
git push origin master

dist/scripts/settings/documents.mjs

+46-31
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ export const Documents = [
1414
title: "Example Project",
1515
href: "/example-project",
1616
},
17-
{
18-
title: "Game Configuration",
19-
href: "/game-config",
20-
},
2117
{
2218
title: "Project Namespaces",
23-
href: "/namespaces"
24-
}
25-
]
19+
href: "/namespaces",
20+
},
21+
],
22+
},
23+
{
24+
spacer: true,
25+
},
26+
{
27+
title: "Project Configuration",
28+
href: "/configuration",
2629
},
2730
{
2831
spacer: true,
@@ -33,19 +36,19 @@ export const Documents = [
3336
items: [
3437
{
3538
title: "Data Privacy",
36-
href: "/data-privacy"
39+
href: "/data-privacy",
3740
},
3841
{
39-
title: "Game Publishing",
40-
href: "/publishing"
42+
title: "Project Publishing",
43+
href: "/publishing",
4144
},
4245
{
4346
title: "Moderation Information",
44-
href: "/moderation"
47+
href: "/moderation",
4548
},
4649
{
4750
title: "Security Guidelines",
48-
href: "/security-guidelines"
51+
href: "/security-guidelines",
4952
},
5053
{
5154
title: "Frequently Asked Questions",
@@ -54,8 +57,8 @@ export const Documents = [
5457
{
5558
title: "Review Process",
5659
href: "/review-process",
57-
}
58-
]
60+
},
61+
],
5962
},
6063
{
6164
spacer: true,
@@ -72,7 +75,7 @@ export const Documents = [
7275
title: "Commands",
7376
href: "/commands",
7477
},
75-
]
78+
],
7679
},
7780
{
7881
spacer: true,
@@ -83,11 +86,11 @@ export const Documents = [
8386
items: [
8487
{
8588
title: "Installation",
86-
href: "/installation"
89+
href: "/installation",
8790
},
8891
{
8992
title: "Features",
90-
href: "/modules",
93+
href: "/features",
9194
items: [
9295
{
9396
title: "Chat Module",
@@ -97,10 +100,6 @@ export const Documents = [
97100
title: "Command Module",
98101
href: "/command",
99102
},
100-
{
101-
title: "Player Ignore Module",
102-
href: "/player-ignore",
103-
},
104103
{
105104
title: "Data Storage Module",
106105
href: "/data",
@@ -114,8 +113,12 @@ export const Documents = [
114113
href: "/leaderboard",
115114
},
116115
{
117-
title: "Queue Module",
118-
href: "/queueing",
116+
title: "Level Module",
117+
href: "/levels",
118+
},
119+
{
120+
title: "Lobby Module",
121+
href: "/lobby",
119122
},
120123
{
121124
title: "Messaging Module",
@@ -141,16 +144,28 @@ export const Documents = [
141144
title: "Punishment Command",
142145
href: "/command",
143146
},
144-
]
147+
],
145148
},
146149
{
147150
title: "Party Module",
148151
href: "/party",
149152
},
153+
{
154+
title: "Player Ignore Module",
155+
href: "/player-ignore",
156+
},
150157
{
151158
title: "Purchase Module",
152159
href: "/purchase",
153160
},
161+
{
162+
title: "Quest Module",
163+
href: "/quest"
164+
},
165+
{
166+
title: "Queue Module",
167+
href: "/queueing",
168+
},
154169
{
155170
title: "Resource Pack Module",
156171
href: "/resourcepack",
@@ -167,9 +182,9 @@ export const Documents = [
167182
title: "World Datapoints",
168183
href: "/datapoints",
169184
},
170-
]
171-
}
172-
]
185+
],
186+
},
187+
],
173188
},
174189
{
175190
title: "Built-In Game Mechanics",
@@ -182,8 +197,8 @@ export const Documents = [
182197
{
183198
title: "Kit Mechanic",
184199
href: "/kit",
185-
}
186-
]
200+
},
201+
],
187202
},
188203
{
189204
title: "Custom Modules",
@@ -200,7 +215,7 @@ export const Documents = [
200215
{
201216
title: "Third Party Resources",
202217
href: "/thirdparty",
203-
}
204-
]
218+
},
219+
],
205220
},
206221
];

0 commit comments

Comments
 (0)