ci: configure forgejo native deployment workflow to cisystem with deploy.sh
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 25s
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 25s
This commit is contained in:
parent
601b9d5afa
commit
262352c769
3 changed files with 41 additions and 38 deletions
|
|
@ -15,8 +15,8 @@ VITE_APP_LOCALE=en-IN
|
||||||
DISABLE_TELEMETRY=1
|
DISABLE_TELEMETRY=1
|
||||||
|
|
||||||
# Select providers as model:provider[:version][:online].
|
# Select providers as model:provider[:version][:online].
|
||||||
SCRAPE_TARGETS=chatgpt:openai-api
|
SCRAPE_TARGETS=chatgpt:openai-api:gpt-4o-mini
|
||||||
ONBOARDING_LLM_TARGET=chatgpt:openai-api
|
ONBOARDING_LLM_TARGET=chatgpt:openai-api:gpt-4o-mini
|
||||||
OPENAI_API_KEY=replace-me
|
OPENAI_API_KEY=replace-me
|
||||||
ANTHROPIC_API_KEY=
|
ANTHROPIC_API_KEY=
|
||||||
MISTRAL_API_KEY=
|
MISTRAL_API_KEY=
|
||||||
|
|
|
||||||
|
|
@ -23,41 +23,11 @@ jobs:
|
||||||
echo "${{ secrets.BETA_EC2_SSH_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.BETA_EC2_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
|
||||||
# Copy app archive and systemd service files
|
CISYSTEM_HOST="172.31.15.84"
|
||||||
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa app.tar.gz getcito.service getcito-worker.service ${{ secrets.BETA_EC2_USERNAME }}@${{ secrets.BETA_EC2_HOST }}:/tmp/
|
CISYSTEM_USER="ubuntu"
|
||||||
|
|
||||||
|
# Copy app archive and systemd service files to cisystem
|
||||||
|
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa app.tar.gz getcito.service getcito-worker.service ${CISYSTEM_USER}@${CISYSTEM_HOST}:/tmp/
|
||||||
|
|
||||||
# Execute deployment commands on cisystem
|
# Execute deployment commands on cisystem
|
||||||
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.BETA_EC2_USERNAME }}@${{ secrets.BETA_EC2_HOST }} << 'EOF'
|
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${CISYSTEM_USER}@${CISYSTEM_HOST} "bash -s" < deploy.sh
|
||||||
set -e
|
|
||||||
|
|
||||||
# 1. Target Directory Setup
|
|
||||||
sudo mkdir -p /home/ubuntu/getcito/logs
|
|
||||||
sudo chown -R ubuntu:ubuntu /home/ubuntu/getcito
|
|
||||||
tar -xzf /tmp/app.tar.gz -C /home/ubuntu/getcito
|
|
||||||
|
|
||||||
cd /home/ubuntu/getcito
|
|
||||||
|
|
||||||
# 2. Environment Configuration
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
cp .env.example .env
|
|
||||||
fi
|
|
||||||
cp .env apps/web/.env
|
|
||||||
|
|
||||||
# 3. Install Dependencies & Build
|
|
||||||
export PATH=/opt/node24/bin:/usr/local/bin:/usr/bin:/bin
|
|
||||||
pnpm install --no-frozen-lockfile
|
|
||||||
pnpm build
|
|
||||||
|
|
||||||
# 4. Systemd Service Deployment
|
|
||||||
sudo cp /tmp/getcito.service /etc/systemd/system/getcito.service
|
|
||||||
sudo cp /tmp/getcito-worker.service /etc/systemd/system/getcito-worker.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable getcito.service getcito-worker.service
|
|
||||||
sudo systemctl restart getcito.service getcito-worker.service
|
|
||||||
|
|
||||||
# 5. Reload Nginx
|
|
||||||
sudo nginx -t && sudo systemctl reload nginx
|
|
||||||
|
|
||||||
rm -f /tmp/app.tar.gz /tmp/getcito.service /tmp/getcito-worker.service
|
|
||||||
echo "GetCito deployed successfully to https://seo.tradhox.com!"
|
|
||||||
EOF
|
|
||||||
|
|
|
||||||
33
deploy.sh
Normal file
33
deploy.sh
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "=== 1. Target Directory Setup ==="
|
||||||
|
sudo mkdir -p /home/ubuntu/getcito/logs
|
||||||
|
sudo chown -R ubuntu:ubuntu /home/ubuntu/getcito
|
||||||
|
tar -xzf /tmp/app.tar.gz -C /home/ubuntu/getcito
|
||||||
|
|
||||||
|
cd /home/ubuntu/getcito
|
||||||
|
|
||||||
|
echo "=== 2. Environment Configuration ==="
|
||||||
|
if [ ! -f .env ]; then
|
||||||
|
cp .env.example .env
|
||||||
|
fi
|
||||||
|
cp .env apps/web/.env
|
||||||
|
|
||||||
|
echo "=== 3. Install Dependencies & Build ==="
|
||||||
|
export PATH=/opt/node24/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
|
pnpm install --no-frozen-lockfile
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
echo "=== 4. Systemd Service Deployment ==="
|
||||||
|
sudo cp /tmp/getcito.service /etc/systemd/system/getcito.service
|
||||||
|
sudo cp /tmp/getcito-worker.service /etc/systemd/system/getcito-worker.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable getcito.service getcito-worker.service
|
||||||
|
sudo systemctl restart getcito.service getcito-worker.service
|
||||||
|
|
||||||
|
echo "=== 5. Reload Nginx ==="
|
||||||
|
sudo nginx -t && sudo systemctl reload nginx
|
||||||
|
|
||||||
|
rm -f /tmp/app.tar.gz /tmp/getcito.service /tmp/getcito-worker.service
|
||||||
|
echo "GetCito deployed successfully to https://seo.tradhox.com!"
|
||||||
Loading…
Reference in a new issue