Skip to content

Commit 04657e9

Browse files
committed
use small wiki list for testing on other
1 parent 0b46974 commit 04657e9

File tree

4 files changed

+78
-10
lines changed

4 files changed

+78
-10
lines changed

.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

container/Dockerfile

Lines changed: 1 addition & 1 deletion
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

scripts/create_module_list.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ import sanitizeHtml from "sanitize-html";
55

66
async function fetchMarkdownData () {
77
try {
8-
const url =
9-
"https://raw.githubusercontent.com/wiki/MagicMirrorOrg/MagicMirror/3rd-Party-Modules.md";
10-
const response = await fetch(url);
11-
if (response.status !== 200) {
12-
throw new Error(`The fetch() call failed. Status code: ${response.status}`);
8+
let markdown = "";
9+
if (process.env.WIKI_FILE) {
10+
markdown = fs.readFileSync(`${process.env.WIKI_FILE}`, "utf8");
11+
} else {
12+
const url =
13+
"https://raw.githubusercontent.com/wiki/MagicMirrorOrg/MagicMirror/3rd-Party-Modules.md";
14+
const response = await fetch(url);
15+
if (response.status !== 200) {
16+
throw new Error(`The fetch() call failed. Status code: ${response.status}`);
17+
}
18+
markdown = await response.text();
1319
}
14-
const markdown = await response.text();
1520
return markdown;
1621
} catch (error) {
1722
console.error(error);

website/test/3rd-Party-Modules.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
- [Notes for Module Creators](#module-creators)
2+
- [Module List](#module-list) organized into categories
3+
- [Development / Core MagicMirror²](#development--core-magicmirror)
4+
- [Finance](#finance)
5+
- [News / Information](#news--information)
6+
- [Transport / Travel](#transport--travel)
7+
- [Voice Control](#voice-control)
8+
- [Weather](#weather)
9+
- [Religion](#religion)
10+
- [Sports](#sports)
11+
- [Utility / IoT / 3rd Party / Integration](#utility--iot--3rd-party--integration)
12+
- [Entertainment / Misc](#entertainment--misc)
13+
- [Health](#health)
14+
- [Education](#education)
15+
- [Outdated Modules](#outdated-modules)
16+
17+
## Module Creators
18+
19+
There is always a need for more modules. Check out the [forum](https://forum.magicmirror.builders/category/9/requests) to see what people are requesting.
20+
21+
### Create your own module
22+
23+
If you want to build your own modules, check out the [MagicMirror² Module Development Documentation](https://docs.magicmirror.builders/development/introduction.html).
24+
25+
When you're done, just edit this page and add your module to the list!
26+
27+
Don't forget to present your module in the [forum](https://forum.magicmirror.builders/category/5/modules).
28+
29+
### General Advice
30+
31+
We highly recommend you to include the following information in your README file:
32+
33+
- A high quality screenshot of your working module.
34+
- A short, one sentence, clear description what it does.
35+
- What external APIs it depend on, including web links to those
36+
- Whether the API/request require a key and the user limitations of those. (Is it free?)
37+
- What is the current development status (WIP, searching for new maintainer or abandoned).
38+
39+
## Module List
40+
41+
The following modules are maintained by their respective authors. If you have a GitHub account, don't forget [to star ⭐](https://docs.github.com/en/get-started/exploring-projects-on-github/saving-repositories-with-stars#starring-a-repository) the modules you like!
42+
43+
[Here](https://modules.magicmirror.builders/) you can find another list based on this official list, but supplemented with screenshots and a search function.
44+
45+
### Development / Core MagicMirror²
46+
47+
|Title |Author |Description |
48+
|:-|:-:|:-|
49+
|[mmpm](https://github.com/Bee-Mar/mmpm) |[Bee-Mar](https://github.com/Bee-Mar) |An unofficial MagicMirror² 3rd Party Package Manager. Automates searching, installation, removal, updating, and upgrading of MagicMirror² modules. |
50+
|[MMM-Template](https://github.com/Dennis-Rosenbaum/MMM-Template) |Dennis-Rosenbaum |A template for creating new MagicMirror² modules. |
51+
|[MMM-AlertExt](https://github.com/MMRIZE/MMM-AlertExt) |MMRIZE |Alternative programmable alert/notification presenter. |
52+
|[MMM-AutoDimmer](https://github.com/Fifteen15Studios/MMM-AutoDimmer) |[Fifteen15Studios](https://github.com/Fifteen15Studios) |Set 1 or more schedules to dim and brighten your screen at specific times. |
53+
|[MMM-Bash](https://github.com/mathew-fleisch/MMM-Bash) |draxiom |A simple module to run a bash/terminal command on a loop, displaying stdout/stderr to screen. |

0 commit comments

Comments
 (0)