generated from CubeCraft-Creations/Tracehound
deploy(dev): rename OpenClaw to RemoteRig, add config.yaml deployment
- BINARY_NAME: openclaw → remoterig - DEPLOY_PATH: /opt/openclaw/openclaw → /opt/remoterig/remoterig - SERVICE: openclaw → remoterig - Deploy tmp path: /tmp/openclaw-deploy → /tmp/remoterig-deploy - Add config.yaml deployment step: copies config.yaml alongside binary on dev host if present in repo - Backup/rollback logic preserved (keeps last 3 backups) - Failure notification path updated to /tmp/remoterig-deploy-failure.txt
This commit is contained in:
@@ -7,10 +7,10 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BINARY_NAME: openclaw
|
||||
BINARY_NAME: remoterig
|
||||
DEV_HOST: ${{ secrets.DEV_HOST }}
|
||||
DEV_USER: ${{ secrets.DEV_USER }}
|
||||
DEPLOY_PATH: /opt/openclaw/openclaw
|
||||
DEPLOY_PATH: /opt/remoterig/remoterig
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
@@ -32,9 +32,9 @@ jobs:
|
||||
cat > deploy.sh <<'SCRIPT'
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
BINARY="${1:-openclaw}"
|
||||
DEPLOY_PATH="${2:-/opt/openclaw/openclaw}"
|
||||
SERVICE="${3:-openclaw}"
|
||||
BINARY="${1:-remoterig}"
|
||||
DEPLOY_PATH="${2:-/opt/remoterig/remoterig}"
|
||||
SERVICE="${3:-remoterig}"
|
||||
TIMESTAMP=$(date +%Y%m%d%H%M%S)
|
||||
BACKUP="${DEPLOY_PATH}.${TIMESTAMP}.bak"
|
||||
|
||||
@@ -69,14 +69,23 @@ jobs:
|
||||
SCRIPT
|
||||
chmod +x deploy.sh
|
||||
|
||||
- name: Deploy config.yaml (if present)
|
||||
run: |
|
||||
if [ -f config.yaml ]; then
|
||||
echo "config.yaml found, will deploy alongside binary"
|
||||
echo "config.yaml" >> deploy-files.txt
|
||||
else
|
||||
echo "no config.yaml in repo, skipping"
|
||||
fi
|
||||
|
||||
- name: Deploy to dev server
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ env.DEV_HOST }}
|
||||
username: ${{ env.DEV_USER }}
|
||||
key: ${{ secrets.DEV_SSH_KEY }}
|
||||
source: "${{ env.BINARY_NAME }},deploy.sh"
|
||||
target: "/tmp/openclaw-deploy"
|
||||
source: "${{ env.BINARY_NAME }},deploy.sh,config.yaml"
|
||||
target: "/tmp/remoterig-deploy"
|
||||
|
||||
- name: Execute deploy on dev server
|
||||
uses: appleboy/ssh-action@v1
|
||||
@@ -86,9 +95,14 @@ jobs:
|
||||
key: ${{ secrets.DEV_SSH_KEY }}
|
||||
script: |
|
||||
set -euo pipefail
|
||||
cd /tmp/openclaw-deploy
|
||||
sudo ./deploy.sh "${{ env.BINARY_NAME }}" "${{ env.DEPLOY_PATH }}" "openclaw"
|
||||
rm -rf /tmp/openclaw-deploy
|
||||
cd /tmp/remoterig-deploy
|
||||
sudo ./deploy.sh "${{ env.BINARY_NAME }}" "${{ env.DEPLOY_PATH }}" "remoterig"
|
||||
if [ -f config.yaml ]; then
|
||||
echo "::config:: deploying config.yaml"
|
||||
sudo mkdir -p "$(dirname "${{ env.DEPLOY_PATH }}")"
|
||||
sudo cp config.yaml "$(dirname "${{ env.DEPLOY_PATH }}")/config.yaml"
|
||||
fi
|
||||
rm -rf /tmp/remoterig-deploy
|
||||
|
||||
- name: Notify on failure
|
||||
if: failure()
|
||||
@@ -98,4 +112,4 @@ jobs:
|
||||
username: ${{ env.DEV_USER }}
|
||||
key: ${{ secrets.DEV_SSH_KEY }}
|
||||
script: |
|
||||
echo "deploy failed for commit ${{ github.sha }} on ${{ github.repository }}" > /tmp/openclaw-deploy-failure.txt
|
||||
echo "deploy failed for commit ${{ github.sha }} on ${{ github.repository }}" > /tmp/remoterig-deploy-failure.txt
|
||||
|
||||
Reference in New Issue
Block a user