11name : 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
810on :
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
2232permissions :
@@ -31,7 +41,7 @@ concurrency:
3141
3242jobs :
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
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