From d97db3d918bfb4dfc1d361fde082a6c7a1ef5ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:31:41 +0100 Subject: [PATCH] fix: deploy workflow Photon -> Tower - SCP + restart on Tower instead of unreachable Photon - Node SSR container with mascarade-frontend network - Requires TOWER_HOST, TOWER_USER, TOWER_SSH_KEY secrets Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/deploy-cloudflare.yml | 41 ++++++++++++++----------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml index 81ebcf3..8380928 100644 --- a/.github/workflows/deploy-cloudflare.yml +++ b/.github/workflows/deploy-cloudflare.yml @@ -1,4 +1,4 @@ -name: Deploy to Cloudflare (via Photon) +name: Deploy to Tower on: push: @@ -31,45 +31,50 @@ jobs: - name: Install dependencies run: npm ci - - name: Build static site + - name: Build site run: npm run build - - name: Deploy to Photon + - name: Deploy to Tower uses: appleboy/scp-action@v0.1.7 with: - host: ${{ secrets.PHOTON_HOST }} - username: root - key: ${{ secrets.PHOTON_SSH_KEY }} + host: ${{ secrets.TOWER_HOST }} + username: ${{ secrets.TOWER_USER }} + key: ${{ secrets.TOWER_SSH_KEY }} source: "dist/" - target: "/tmp/site-dist/" + target: "/home/clems/electron-rare-site/" overwrite: true rm: true - name: Restart site container uses: appleboy/ssh-action@v1.0.3 with: - host: ${{ secrets.PHOTON_HOST }} - username: root - key: ${{ secrets.PHOTON_SSH_KEY }} + host: ${{ secrets.TOWER_HOST }} + username: ${{ secrets.TOWER_USER }} + key: ${{ secrets.TOWER_SSH_KEY }} script: | + cd /home/clems/electron-rare-site docker rm -f electron-rare-site 2>/dev/null || true docker run -d \ --name electron-rare-site \ - --network zacus-stack_default \ - -v /tmp/site-dist/dist:/app/dist \ - -p 127.0.0.1:4321:4321 \ + --network mascarade-frontend \ + -v /home/clems/electron-rare-site/dist:/app/dist \ + -v /home/clems/electron-rare-site/node_modules:/app/node_modules \ + -w /app \ + -p 4321:4321 \ + -e HOST=0.0.0.0 \ + -e PORT=4321 \ --restart unless-stopped \ node:22-alpine \ - sh -c 'npm install -g serve 2>/dev/null && serve /app/dist -l 4321 -s' + node dist/server/entry.mjs - name: Verify deployment uses: appleboy/ssh-action@v1.0.3 with: - host: ${{ secrets.PHOTON_HOST }} - username: root - key: ${{ secrets.PHOTON_SSH_KEY }} + host: ${{ secrets.TOWER_HOST }} + username: ${{ secrets.TOWER_USER }} + key: ${{ secrets.TOWER_SSH_KEY }} script: | - sleep 8 + sleep 5 STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:4321/) if [ "$STATUS" != "200" ]; then echo "Site returned $STATUS instead of 200"