Skip to content

Commit cea312b

Browse files
committed
Prepare for migration & convert to monorepo.
~ Transition from Github Pages to Netlify ~ Make this a public monorepo.
1 parent 7d06307 commit cea312b

File tree

7 files changed

+67
-0
lines changed

7 files changed

+67
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Auto Update Submodules
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' # Runs daily at midnight UTC
7+
8+
jobs:
9+
update-submodules:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
submodules: true
16+
token: ${{ secrets.GH_PAT }}
17+
18+
- name: Check and update submodules
19+
run: |
20+
git submodule foreach --quiet '
21+
remote_url=$(git remote get-url origin)
22+
branch=$(git rev-parse --abbrev-ref HEAD)
23+
latest_remote_commit=$(git ls-remote $remote_url $branch | awk "{print \$1}")
24+
current_commit=$(git rev-parse HEAD)
25+
26+
if [ "$latest_remote_commit" != "$current_commit" ]; then
27+
echo "Updating submodule $name..."
28+
git fetch origin $branch
29+
git checkout $latest_remote_commit
30+
cd ..
31+
git add $name
32+
else
33+
echo "No updates for submodule $name."
34+
fi
35+
'
36+
37+
- name: Commit and push changes if any
38+
run: |
39+
if git diff --cached --quiet; then
40+
echo "No changes to commit."
41+
exit 0
42+
fi
43+
44+
git config --global user.email "github-actions@github.com"
45+
git config --global user.name "GitHub Actions"
46+
git commit -m "Auto-update submodules with new commits"
47+
git push origin HEAD:main # Change 'main' if your default branch is different

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[submodule "mttnotes"]
2+
path = mttnotes
3+
url = https://github.com/mrtechtroid/mttnotes.git
4+
[submodule "edu"]
5+
path = edu
6+
url = https://github.com/mrtechtroid/edu.git
7+
[submodule "GameHub"]
8+
path = GameHub
9+
url = https://github.com/mrtechtroid/GameHub.git
10+
[submodule "2048"]
11+
path = 2048
12+
url = https://github.com/mrtechtroid/2048.git
13+
[submodule "r"]
14+
path = r
15+
url = https://github.com/mrtechtroid/r.git

2048

Submodule 2048 added at 47ab563

GameHub

Submodule GameHub added at 37d277b

edu

Submodule edu added at f4193d7

mttnotes

Submodule mttnotes added at 7c05391

r

Submodule r added at 981f6e0

0 commit comments

Comments
 (0)