Repository navigation
T-4: Add Lightsail deploy script, nginx snippet and Deploy docs - #32
Merged
Merged
Conversation
Added deploy/deploy.sh (env-var checks before building, --dry-run, --skip-build, rsync --delay-updates over SSH), deploy/nginx/dojo.conf (wasm/mjs MIME, immutable caching for assets/, no-cache index.html, gzip, 404 with no SPA fallback), a README Deploy section and updated Status, and AGENTS.md entries.
Verified: bash -n and shellcheck clean; missing var exits 1 naming it before building; --dry-run builds and prints the rsync command (the transfer itself could not connect to a placeholder host); nginx syntax ok (full -t only failed on log-file permissions in this sandbox).
The served URL is a placeholder in README until the host name is known.
Plan:
- [x] Read repo
- [x] deploy.sh
- [x] dojo.conf
- [x] README and AGENTS
- [x] Verify
Formic-Usage: {"model":"sonnet","tokensIn":140442,"tokensOut":4542,"costCents":0}
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added deploy/deploy.sh (env-var checks before building, --dry-run, --skip-build, rsync --delay-updates over SSH), deploy/nginx/dojo.conf (wasm/mjs MIME, immutable caching for assets/, no-cache index.html, gzip, 404 with no SPA fallback), a README Deploy section and updated Status, and AGENTS.md entries.
Verified: bash -n and shellcheck clean; missing var exits 1 naming it before building; --dry-run builds and prints the rsync command (the transfer itself could not connect to a placeholder host); nginx syntax ok (full -t only failed on log-file permissions in this sandbox).
The served URL is a placeholder in README until the host name is known.
Plan:
Formic-Usage: {"model":"sonnet","tokensIn":140442,"tokensOut":4542,"costCents":0}
Closes #23.
T-4 — Deploy the static dist/ build to the existing Lightsail nginx
User story: As a DJ practising with DoJo, I'd like to open the Phase 1 trainer at a URL served from our Lightsail instance, so that I can train in any browser without cloning the repo and running a dev server.
Requirements
npm ci && npm run build(or skips the build with a flag) and rsyncs dist/ over SSH to the box. Host, SSH user and remote web root come from env vars (e.g. DOJO_DEPLOY_HOST, DOJO_DEPLOY_USER, DOJO_DEPLOY_PATH) with no hostnames, keys or secrets committed; the script fails with a clear message when one is missing and supports a --dry-run that prints the rsync it would run (rsync --dry-run). Upload hashed assets before index.html (or use --delay-updates) so a visitor never gets an index.html pointing at assets not yet uploaded..wasmto application/wasm and.mjsto text/javascript (older nginx mime.types lack them) alongside the default mime.types;assets/(Vite's content-hashed output) getsCache-Control: public, max-age=31536000, immutable; index.html getsCache-Control: no-cache; gzip on for js/css/svg/wasm. The app has no client-side routing (single index.html, vite base './'), so usetry_files $uri $uri/ =404and NO index.html fallback; say so in a comment. Keep server_name and root as clearly marked placeholders to adapt on the box.sudo nginx -t && sudo systemctl reload nginx), how to roll back (redeploy a previous commit), and the URL/path the app is served at (placeholder to fill in if not known). Add deploy/ with its representative file to AGENTS.md's 'Where things are' and the deploy command to its Conventions.bash -n deploy/deploy.sh, shellcheck if available,deploy/deploy.sh --dry-runagainst a placeholder host, andnginx -ton the snippet if nginx is available locally (e.g. in Docker).Acceptance criteria
File scope
AGENTS.md,README.md,deployNo verification command was run.
Opened by a Formic Coder Agent.