Commit
This commit is contained in:
@@ -37,6 +37,9 @@ containers untouched.
|
||||
`deploy.ps1`. Keep using the root script directly.
|
||||
- [scripts/deploy-remote.sh](scripts/deploy-remote.sh)
|
||||
- Server-side helper that updates only the `goodwalk-svelte` compose project.
|
||||
- [scripts/deploy-from-git.sh](scripts/deploy-from-git.sh)
|
||||
- Standalone server-side entrypoint that pulls from Git, then runs the same
|
||||
compose/nginx deployment steps on the server.
|
||||
- [docker-compose.prod.yml](docker-compose.prod.yml)
|
||||
- Production compose file for the new Svelte app, mail API, and Postgres.
|
||||
- `scripts/export-homepage-content.mjs`
|
||||
@@ -129,6 +132,69 @@ To rebuild and restart only one service, for example the mail API:
|
||||
powershell -ExecutionPolicy Bypass -File .\deploy.ps1 -Force -Service mail-api
|
||||
```
|
||||
|
||||
## Remote Git deploy
|
||||
|
||||
If you want the production server to pull straight from Gitea instead of
|
||||
receiving an uploaded tarball from Windows, use
|
||||
[scripts/deploy-from-git.sh](scripts/deploy-from-git.sh) on the server.
|
||||
|
||||
Recommended credential setup for a private HTTPS repo:
|
||||
|
||||
```bash
|
||||
umask 077
|
||||
cat > ~/.netrc <<'EOF'
|
||||
machine g.sublogue.com
|
||||
login YOUR_GITEA_USERNAME
|
||||
password YOUR_READ_ONLY_TOKEN
|
||||
EOF
|
||||
chmod 600 ~/.netrc
|
||||
```
|
||||
|
||||
Install the script on the server and make it executable:
|
||||
|
||||
```bash
|
||||
install -m 0755 scripts/deploy-from-git.sh /usr/local/bin/goodwalk-deploy
|
||||
```
|
||||
|
||||
The remote host must have `git` and `docker`. A host-level `node` install is
|
||||
optional; if it is missing, the script will export homepage content using a
|
||||
temporary `node:22-alpine` container instead.
|
||||
|
||||
Run a full deploy from the repo:
|
||||
|
||||
```bash
|
||||
/usr/local/bin/goodwalk-deploy \
|
||||
--repo-url https://g.sublogue.com/admin/gw-svelte.git \
|
||||
--branch main \
|
||||
--deploy-path /docker/goodwalk-svelte \
|
||||
--compose-file docker-compose.prod.yml \
|
||||
--project-name goodwalk-svelte \
|
||||
--nginx-source nginx/goodwalk.co.nz.svelte.conf.example \
|
||||
--nginx-target /docker/nginx/conf.d/goodwalk.co.nz.conf \
|
||||
--nginx-compose-file /docker/nginx/docker-compose.yml \
|
||||
--nginx-project-name nginx \
|
||||
--maintenance-host-dir /docker/nginx/maintenance \
|
||||
--maintenance-flag /docker/nginx/conf.d/maintenance.flag
|
||||
```
|
||||
|
||||
Deploy a specific commit or tag:
|
||||
|
||||
```bash
|
||||
/usr/local/bin/goodwalk-deploy \
|
||||
--repo-url https://g.sublogue.com/admin/gw-svelte.git \
|
||||
--branch main \
|
||||
--ref <commit-or-tag> \
|
||||
--deploy-path /docker/goodwalk-svelte \
|
||||
--compose-file docker-compose.prod.yml \
|
||||
--project-name goodwalk-svelte \
|
||||
--nginx-source nginx/goodwalk.co.nz.svelte.conf.example \
|
||||
--nginx-target /docker/nginx/conf.d/goodwalk.co.nz.conf \
|
||||
--nginx-compose-file /docker/nginx/docker-compose.yml \
|
||||
--nginx-project-name nginx \
|
||||
--maintenance-host-dir /docker/nginx/maintenance \
|
||||
--maintenance-flag /docker/nginx/conf.d/maintenance.flag
|
||||
```
|
||||
|
||||
## Homepage content sync
|
||||
|
||||
Local development can feel fresher than production because production reads the
|
||||
|
||||
Reference in New Issue
Block a user