Install npm assets in CI release build and pin Node

This commit is contained in:
2026-11-10 08:47:46 +01:00
parent 7463784e03
commit fda52dd2e7
3 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -77,12 +77,14 @@ jobs:
_build
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-mix-prod-${{ hashFiles('mix.lock', 'mise.toml') }}
assets/node_modules
key: ${{ runner.os }}-mix-prod-${{ hashFiles('mix.lock', 'mise.toml', 'assets/package-lock.json') }}
restore-keys: |
${{ runner.os }}-mix-prod-
- run: mix local.hex --force
- run: mix local.rebar --force
- run: npm ci --prefix assets --no-audit --no-fund
- run: mix deps.get --only prod
- run: mix assets.setup
- run: mix assets.deploy
+7
View File
@@ -18,6 +18,7 @@ Internet
| Erlang | 28.5 |
| Elixir | 1.19.5-otp-28 |
| Rust | 1.98.1 |
| Node.js | 24 (asset build only) |
| Postgres | `postgres:18.0`, pinned directly in the unified compose |
| Caddy | 2.11.9 |
| Docker | 29.9.3 |
@@ -34,6 +35,7 @@ A new Ubuntu 24.04 VPS needs:
- Docker Engine and the Compose plugin
- Caddy
- `curl`, `ca-certificates`, `libstdc++6`, `openssl`
- Node.js 24 + npm if you build the release on this host instead of CI
- DNS and TLS for the domain
- A non-root deploy user with SSH access
@@ -307,6 +309,8 @@ Build on a machine matching Ubuntu 24.04 / glibc 2.39, or let CI do it.
The release tarball is the contents of the release directory:
```sh
npm ci --prefix assets --no-audit --no-fund
export MIX_ENV=prod
mix deps.get --only prod
mix assets.deploy
@@ -315,6 +319,9 @@ mix release
tar -czf chesstrainer-release.tar.gz -C _build/prod/rel/chesstrainer .
```
`npm ci` is required before `mix assets.deploy`: Tailwind imports the
Chessground CSS and esbuild bundles the package from `assets/node_modules`.
`mix assets.deploy` runs `compile` first so the generated LiveView colocated
CSS exists.
+1
View File
@@ -2,3 +2,4 @@
erlang = "28.5"
elixir = "1.19.5-otp-28"
rust = "1.98.1"
node = "24"