Skip to content

Commit ed08071

Browse files
committed
feat(demo): automate OCI deployment via GitHub Actions
- Add deploy-demo.yml workflow: SSH deploy on push to main/public_demo, auto-downloads fixtures if absent, rebuilds and restarts the stack - Add reset_demo.sh: wipes postgres/redis/media volumes, preserves caddy_data/caddy_config to avoid Let's Encrypt rate limits - Update docker-compose.demo.yml: add restart policies, make REQUESTS_CA_BUNDLE/CURL_CA_BUNDLE variable-substituted for OCI vs. local dev - Update .env.demo.example: add CA bundle section defaulting to system bundle - Update demo-commands.sh: also read COMPOSE_FILE from .env - Update DEMO_DEPLOY.md: full OCI deployment guide replacing Fly.io content, add automated deploy notes and local testing variable table
1 parent 25f845b commit ed08071

6 files changed

Lines changed: 381 additions & 146 deletions

File tree

.github/workflows/deploy-demo.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Demo
2+
3+
on:
4+
push:
5+
branches: ["main", "public_demo"]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
environment: demo
11+
12+
steps:
13+
- name: Deploy to OCI demo server
14+
uses: appleboy/ssh-action@v1
15+
with:
16+
host: ${{ vars.DEMO_SSH_HOST }}
17+
username: ubuntu
18+
key: ${{ secrets.DEMO_SSH_KEY }}
19+
script: |
20+
set -e
21+
cd /opt/nexuslims-cdcs
22+
23+
echo "=== Pulling latest code (branch: ${{ github.ref_name }}) ==="
24+
git fetch origin
25+
git checkout ${{ github.ref_name }}
26+
git pull origin ${{ github.ref_name }}
27+
28+
echo "=== Downloading fixtures (if absent) ==="
29+
cd deployment
30+
if [ ! -d "fixtures/demo_data/nx-data" ]; then
31+
./scripts/manage-demo-fixtures.sh download
32+
else
33+
echo " Fixtures already present, skipping download"
34+
fi
35+
36+
echo "=== Building CDCS container ==="
37+
export COMPOSE_FILE="docker-compose.base.yml:docker-compose.demo.yml"
38+
COMPOSE_BAKE=true docker compose build cdcs
39+
40+
echo "=== Restarting stack ==="
41+
docker compose down
42+
docker compose up -d
43+
44+
echo "=== Deploy complete ==="

deployment/.env.demo.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ NX_INSTRUMENT_DATA_PATH=/srv/nx-instrument-data
7575
# docker-compose.demo.yml mounts these from deployment/fixtures/demo_data/
7676
# (no need to set host paths here - the compose override handles it)
7777

78+
# ----------------------------------------------------------------------------
79+
# CA Bundle for outbound HTTPS from within the container
80+
# ----------------------------------------------------------------------------
81+
# OCI / Let's Encrypt: use the system bundle
82+
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
83+
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
84+
# Local dev with Caddy local CA: comment the two lines above and uncomment:
85+
# REQUESTS_CA_BUNDLE=/etc/ssl/certs/caddy-root-ca.crt
86+
# CURL_CA_BUNDLE=/etc/ssl/certs/caddy-root-ca.crt
87+
7888
# ----------------------------------------------------------------------------
7989
# XSLT Configuration
8090
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)