mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Install npm assets in CI release build and pin Node
This commit is contained in:
@@ -77,12 +77,14 @@ jobs:
|
|||||||
_build
|
_build
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.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: |
|
restore-keys: |
|
||||||
${{ runner.os }}-mix-prod-
|
${{ runner.os }}-mix-prod-
|
||||||
|
|
||||||
- run: mix local.hex --force
|
- run: mix local.hex --force
|
||||||
- run: mix local.rebar --force
|
- run: mix local.rebar --force
|
||||||
|
- run: npm ci --prefix assets --no-audit --no-fund
|
||||||
- run: mix deps.get --only prod
|
- run: mix deps.get --only prod
|
||||||
- run: mix assets.setup
|
- run: mix assets.setup
|
||||||
- run: mix assets.deploy
|
- run: mix assets.deploy
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Internet
|
|||||||
| Erlang | 28.5 |
|
| Erlang | 28.5 |
|
||||||
| Elixir | 1.19.5-otp-28 |
|
| Elixir | 1.19.5-otp-28 |
|
||||||
| Rust | 1.98.1 |
|
| Rust | 1.98.1 |
|
||||||
|
| Node.js | 24 (asset build only) |
|
||||||
| Postgres | `postgres:18.0`, pinned directly in the unified compose |
|
| Postgres | `postgres:18.0`, pinned directly in the unified compose |
|
||||||
| Caddy | 2.11.9 |
|
| Caddy | 2.11.9 |
|
||||||
| Docker | 29.9.3 |
|
| Docker | 29.9.3 |
|
||||||
@@ -34,6 +35,7 @@ A new Ubuntu 24.04 VPS needs:
|
|||||||
- Docker Engine and the Compose plugin
|
- Docker Engine and the Compose plugin
|
||||||
- Caddy
|
- Caddy
|
||||||
- `curl`, `ca-certificates`, `libstdc++6`, `openssl`
|
- `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
|
- DNS and TLS for the domain
|
||||||
- A non-root deploy user with SSH access
|
- 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:
|
The release tarball is the contents of the release directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
npm ci --prefix assets --no-audit --no-fund
|
||||||
|
|
||||||
export MIX_ENV=prod
|
export MIX_ENV=prod
|
||||||
mix deps.get --only prod
|
mix deps.get --only prod
|
||||||
mix assets.deploy
|
mix assets.deploy
|
||||||
@@ -315,6 +319,9 @@ mix release
|
|||||||
tar -czf chesstrainer-release.tar.gz -C _build/prod/rel/chesstrainer .
|
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
|
`mix assets.deploy` runs `compile` first so the generated LiveView colocated
|
||||||
CSS exists.
|
CSS exists.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user