Skip to content

Commit a4b2b69

Browse files
Refac/site seperation (#52)
* refac: WIP add inital seperation logic leveragin bun workspaces, bun catalogs * feat: update site workflwos to accomodate the spitting of sites * fix: astro expressive code error * fix: sharp dependency issue * perf: optimize fonts * refac: make use of the shared assets * feat: add inital docs for flatpak and site seperation * feat: update docs to talk about the new way of Flatpak handling * refac: use bun.lock directly instead of npm shit * feat: add toc config to show more deep headings * refac: rename file name of the site * refac: remove npm install for windows 11 arm * feat: make site build check run on pr on dev
1 parent 258c282 commit a4b2b69

89 files changed

Lines changed: 871 additions & 14052 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.

.github/workflows/app-build-debug-artifacts.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ jobs:
5858
- name: setup bun
5959
uses: oven-sh/setup-bun@v2
6060
- name: install frontend dependencies
61-
if: matrix.platform != 'windows-11-arm'
6261
run: bun i
63-
- name: install frontend dependencies (Windows ARM)
64-
if: matrix.platform == 'windows-11-arm'
65-
run: npm install
6662

6763
# ------------- Rust -------------
6864
- name: install Rust stable (desktop)

.github/workflows/app-build-release-artifacts.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,8 @@ jobs:
6464
6565
# Case 1: Run bun for everything EXCEPT Windows ARM
6666
- name: install frontend dependencies
67-
if: matrix.platform != 'windows-11-arm'
6867
run: bun i
6968

70-
# Case 2: Run npm ONLY for Windows ARM
71-
- name: install frontend dependencies (Windows ARM)
72-
if: matrix.platform == 'windows-11-arm'
73-
run: npm install
74-
7569
# ------------- Rust & Cargo Cache -------------
7670
- name: install Rust stable (desktop)
7771
if: matrix.mobile == ''

.github/workflows/app-build-release-publish.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,8 @@ jobs:
6363
6464
# Case 1: Run bun for everything EXCEPT Windows ARM
6565
- name: install frontend dependencies
66-
if: matrix.platform != 'windows-11-arm'
6766
run: bun i
6867

69-
# Case 2: Run npm ONLY for Windows ARM
70-
- name: install frontend dependencies (Windows ARM)
71-
if: matrix.platform == 'windows-11-arm'
72-
run: npm install
73-
7468
# ------------- Rust & Cargo Cache -------------
7569
- name: install Rust stable (desktop)
7670
if: matrix.mobile == ''
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: 'site-build-check'
2+
3+
on:
4+
pull_request:
5+
branches: [staging, dev]
6+
paths: ['apps/site-*/**', '.github/workflows/site-check.yml']
7+
8+
push:
9+
branches: [staging]
10+
paths: ['apps/site-*/**', '.github/workflows/site-check.yml']
11+
12+
workflow_dispatch:
13+
14+
jobs:
15+
setup:
16+
runs-on: ubuntu-slim
17+
outputs:
18+
apps: '${{ steps.set.outputs.apps }}'
19+
steps:
20+
- uses: actions/checkout@v5
21+
- id: set
22+
run: echo "apps=$(ls apps | grep '^site-' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
23+
24+
build:
25+
needs: setup
26+
runs-on: ubuntu-slim
27+
strategy:
28+
matrix:
29+
app: '${{ fromJson(needs.setup.outputs.apps) }}'
30+
steps:
31+
- uses: actions/checkout@v5
32+
33+
- uses: oven-sh/setup-bun@v2
34+
35+
- run: bun i
36+
37+
- name: Build
38+
working-directory: apps/${{ matrix.app }}
39+
run: |
40+
bun run build
41+
path=$(grep "base:" astro.config.mjs | sed -E "s/.*base:\s*['\"]Cherit\/?([^'\"]*)['\"].*/\1/" | tr -d /)
42+
echo "$path" > ../../${{ matrix.app }}_path.txt
43+
env:
44+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
45+
46+
- uses: actions/upload-artifact@v4
47+
with:
48+
name: ${{ matrix.app }}-dist
49+
path: |
50+
apps/${{ matrix.app }}/dist
51+
${{ matrix.app }}_path.txt
52+
53+
merge:
54+
needs: build
55+
runs-on: ubuntu-slim
56+
steps:
57+
- uses: actions/download-artifact@v4
58+
with:
59+
path: artifacts
60+
pattern: 'site-*-dist'
61+
62+
- name: Merge Artifacts
63+
run: |
64+
mkdir out
65+
for d in artifacts/site-*-dist; do
66+
A=$(basename "$d" -dist)
67+
P=$(cat "$d/${A}_path.txt")
68+
mkdir -p "out/$P"
69+
cp -r "$d/apps/$A/dist/"* "out/$P/"
70+
done
71+
72+
- uses: actions/upload-artifact@v4
73+
with:
74+
name: site-build-output
75+
path: out

.github/workflows/site-check.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/site-deploy.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'apps/site/**'
7+
- 'apps/site-*/**'
88
- '.github/workflows/site-deploy.yml'
99

1010
workflow_dispatch:
@@ -18,29 +18,40 @@ jobs:
1818
build:
1919
runs-on: ubuntu-slim
2020
steps:
21-
- name: Checkout your repository using git
22-
uses: actions/checkout@v5
21+
- uses: actions/checkout@v5
2322

24-
# Install dependencies at root (Monorepo context)
25-
- name: Setup Bun
26-
uses: oven-sh/setup-bun@v2
27-
- name: Install dependencies
28-
run: bun i
23+
- uses: oven-sh/setup-bun@v2
2924

30-
- name: Install, build, and upload your site
31-
uses: withastro/action@v5
32-
with:
33-
path: 'apps/site'
25+
- run: bun i
26+
27+
- name: Build & Merge
28+
run: |
29+
mkdir out
30+
for d in apps/site-*/; do
31+
app=$(basename "$d")
32+
echo "Building $app..."
33+
34+
cd "$d"
35+
bun run build
36+
path=$(grep "base:" astro.config.mjs | sed -E "s/.*base:\s*['\"]Cherit\/?([^'\"]*)['\"].*/\1/" | tr -d /)
37+
38+
mkdir -p "../../out/$path"
39+
cp -r dist/* "../../out/$path/"
40+
cd ../..
41+
done
3442
env:
35-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
44+
45+
- uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: out
3648

3749
deploy:
3850
needs: build
3951
runs-on: ubuntu-slim
4052
environment:
4153
name: github-pages
42-
url: ${{ steps.deployment.outputs.page_url }}
54+
url: '${{ steps.deployment.outputs.page_url }}'
4355
steps:
44-
- name: Deploy to GitHub Pages
45-
id: deployment
56+
- id: deployment
4657
uses: actions/deploy-pages@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<img src="apps/site/src/assets/images/logo_500.png" alt="Lokus" width="120" height="120" />
3+
<img src="packages/shared-packages/images/logo_500.png" alt="Lokus" width="120" height="120" />
44

55
# Cherit
66

0 commit comments

Comments
 (0)