Skip to content

Commit 38ff5dd

Browse files
authored
Merge pull request #226 from JumpLink/feat/website
feat(website): add a landing page
2 parents d5f4e2b + a9d5de2 commit 38ff5dd

47 files changed

Lines changed: 6293 additions & 7 deletions

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,5 @@ jobs:
208208
gjsify workspace @learn6502/app-web check
209209
gjsify workspace @learn6502/app-gnome check:typescript
210210
gjsify workspace @learn6502/app-android check
211+
gjsify workspace @learn6502/website check
212+
gjsify workspace @learn6502/website test

‎.github/workflows/deploy-pages.yml‎

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Deploy Pages
22

3-
# Builds the app-web Adwaita SPA (`gjsify build --app browser`) and deploys it to
4-
# GitHub Pages — the successor to the legacy Jekyll build of the classic tutorial
5-
# (removed in the app-web rewrite). Point Settings → Pages → Source at
3+
# Builds the landing page (packages/website, static HTML generated from the
4+
# AppStream metainfo) and the app-web Adwaita SPA (`gjsify build --app browser`)
5+
# and deploys both to GitHub Pages: the landing page at /Learn6502/, the web app
6+
# at /Learn6502/app/. The successor to the legacy Jekyll build of the classic
7+
# tutorial (removed in the app-web rewrite). Point Settings → Pages → Source at
68
# "GitHub Actions" for this workflow to serve the site.
79

810
on:
@@ -15,8 +17,16 @@ on:
1517
- "packages/ui/**"
1618
- "packages/core/**"
1719
- "packages/examples/**"
20+
- "packages/website/**"
21+
- "packages/translations/**"
22+
- "packages/app-gnome/data/metainfo/**"
23+
- "package.json"
24+
- "misc/screenshots/**"
1825
- "gjsify-lock.json"
1926
- ".github/workflows/deploy-pages.yml"
27+
# New release assets and download counts change what the landing page shows.
28+
release:
29+
types: [published]
2030
workflow_dispatch:
2131

2232
permissions:
@@ -31,7 +41,7 @@ concurrency:
3141

3242
jobs:
3343
build:
34-
name: Build web app
44+
name: Build landing page and web app
3545
runs-on: ubuntu-latest
3646
# `gjsify build`/`gjsify tsc` spawn `gjs` (unavailable on ubuntu-latest), so
3747
# build in a Fedora 43 container (GJS 1.86 / SpiderMonkey 140) — the same
@@ -56,6 +66,10 @@ jobs:
5666

5767
- name: Checkout repository
5868
uses: actions/checkout@v6
69+
with:
70+
# A `release` event runs on the tag's commit, which can predate the
71+
# site; the page must always be built from the default branch.
72+
ref: ${{ github.event_name == 'release' && github.event.repository.default_branch || github.ref }}
5973

6074
- name: Setup Node.js
6175
uses: actions/setup-node@v6
@@ -105,10 +119,25 @@ jobs:
105119
- name: Build web app
106120
run: gjsify workspace @learn6502/app-web build:app
107121

122+
# The release list and download counts come from the GitHub API; the token
123+
# only lifts the rate limit. A failed lookup warns and the page links to the
124+
# releases instead of failing the deploy.
125+
- name: Build landing page
126+
run: gjsify workspace @learn6502/website build
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
130+
# The web app is relative-path only (`./app.js`), so it can sit below the
131+
# landing page without a base change.
132+
- name: Place the web app below the landing page
133+
run: |
134+
mkdir -p packages/website/dist/app
135+
cp -r packages/app-web/dist-app/. packages/website/dist/app/
136+
108137
- name: Upload Pages artifact
109138
uses: actions/upload-pages-artifact@v3
110139
with:
111-
path: packages/app-web/dist-app
140+
path: packages/website/dist
112141

113142
deploy:
114143
name: Deploy to GitHub Pages

0 commit comments

Comments
 (0)