Skip to content

Commit 3878958

Browse files
Merge pull request #94
2 parents 0c7be6b + f011459 commit 3878958

2,532 files changed

Lines changed: 135 additions & 56 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.husky/*
22
/.github/*
3-
/docs/data/*
4-
/docs/images/*
3+
/website/data/*
4+
/website/images/*
55
/guides/*
6+
*.md

.github/workflows/container-build.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
workflow_dispatch: # needed for manually running this workflow
55
schedule:
66
- cron: "15 3 * * *" # sadly there is no TZ support here
7+
push:
8+
branches:
9+
- "*"
710

811
permissions:
912
contents: read
@@ -21,15 +24,22 @@ jobs:
2124
uses: actions/checkout@v5
2225
- name: Build container
2326
run: |
27+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
28+
# ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
29+
REPO="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
30+
# regular build
31+
PARAMS="--output type=image,\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true"
32+
else
33+
# only build with small wiki list and no image push
34+
PARAMS="--output type=image,push=false --opt build-arg:WIKI_FILE=website/test/3rd-Party-Modules.md"
35+
fi
2436
# registry credentials
2537
export DOCKER_CONFIG="$(pwd)/container"
2638
echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"$(echo -n ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} | base64 -w 0)\"}}}" > $DOCKER_CONFIG/config.json
27-
# ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
28-
REPO="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
2939
# build
3040
buildctl-daemonless.sh build \
3141
--progress plain \
3242
--frontend=dockerfile.v0 \
3343
--local context=. \
3444
--local dockerfile=container \
35-
--output type=image,"\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true"
45+
$PARAMS

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.js
2-
docs/data/*.json
3-
docs/fonts/
2+
website/data/*.json
3+
website/fonts/
44
modules/
55
result.md
66
modules_temp/

README.md

Lines changed: 12 additions & 2 deletions

container/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /workspace
44

55
COPY . .
66

7-
ARG GITHUB_TOKEN
7+
ARG GITHUB_TOKEN WIKI_FILE
88
RUN <<EOF
99
set -e
1010
git config --global --add safe.directory /workspace
@@ -21,6 +21,6 @@ LABEL maintainer="MagicMirrorOrg"
2121
COPY container/default.conf /etc/nginx/conf.d/
2222
COPY container/nginx.conf /etc/nginx/
2323

24-
COPY --from=builder /workspace/docs /usr/share/nginx/docs/
24+
COPY --from=builder /workspace/website /usr/share/nginx/website/
2525

2626
EXPOSE 8080

container/default.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ server {
55
access_log /var/log/nginx/access.log main;
66

77
location / {
8-
root /usr/share/nginx/docs;
8+
root /usr/share/nginx/website;
99
index index.html index.htm;
1010
# Do not cache HTML to allow quick refresh of UI changes
1111
add_header Cache-Control "no-cache, no-store, must-revalidate";
1212
add_header Pragma "no-cache";
1313
add_header Expires "0";
1414
}
1515

16-
# Cache-bust static assets aggressively; paths are stable under docs/
16+
# Cache-bust static assets aggressively; paths are stable under website/
1717
location ~* \.(?:css|js|svg|woff2?|ttf|eot|ico|png|jpg|jpeg|gif|webp)$ {
18-
root /usr/share/nginx/docs;
18+
root /usr/share/nginx/website;
1919
access_log off;
2020
expires 30d;
2121
add_header Cache-Control "public, max-age=2592000, immutable";

create_own_module_list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function createModuleList () {
3939
};
4040

4141
fs.writeFileSync(
42-
"./docs/data/modules.stage.1.json",
42+
"./website/data/modules.stage.1.json",
4343
JSON.stringify(data, null, 2),
4444
"utf8"
4545
);

cspell.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"node_modules/",
3434
"modules/",
3535
"modules_temp/",
36-
"docs/**",
36+
"website/**",
3737
"eslint-config-DEBUG.json",
3838
"container/"
3939
],

eslint.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export default defineConfig([
1313
ignores: [
1414
"modules/*",
1515
"modules_temp/*",
16-
"docs/data/modules*.json",
17-
"docs/fonts/*",
18-
"docs/result.html",
19-
"docs/result.md"
16+
"website/data/modules*.json",
17+
"website/fonts/*",
18+
"website/result.html",
19+
"website/result.md"
2020
]
2121
},
2222
{

scripts/check_modules.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def check_modules():
273273
}
274274

275275
modules_json_file = open(
276-
"./docs/data/modules.stage.5.json", encoding="utf-8")
276+
"./website/data/modules.stage.5.json", encoding="utf-8")
277277
modules = json.load(modules_json_file)
278278
stats = {
279279
"moduleCounter": 0,
@@ -566,29 +566,29 @@ def check_modules():
566566
)
567567

568568
# Writing to markdown
569-
with open("./docs/result.md", "w", encoding="utf-8") as output_file:
569+
with open("./website/result.md", "w", encoding="utf-8") as output_file:
570570
output_file.write(markdown_output)
571571

572572
# Serializing json
573573
json_object = json.dumps(modules, indent=2)
574574

575575
# Writing to modules.json
576-
with open("./docs/data/modules.json", "w", encoding="utf-8") as outfile:
576+
with open("./website/data/modules.json", "w", encoding="utf-8") as outfile:
577577
outfile.write(json_object)
578578

579579
# Serializing and minifying json
580580
json_object = json.dumps(modules)
581581

582582
# Writing to modules.min.json
583-
with open("./docs/data/modules.min.json", "w", encoding="utf-8") as outfile:
583+
with open("./website/data/modules.min.json", "w", encoding="utf-8") as outfile:
584584
outfile.write(json_object)
585585

586586
# Statistics
587587
# Serializing json
588588
statistics_json_object = json.dumps(stats, indent=2)
589589

590590
# Writing to stats.json
591-
with open("./docs/data/stats.json", "w", encoding="utf-8") as outfile:
591+
with open("./website/data/stats.json", "w", encoding="utf-8") as outfile:
592592
outfile.write(statistics_json_object)
593593

594594

0 commit comments

Comments
 (0)