Skip to content

chore: setup ci for testing with docker compose (#29) #15

chore: setup ci for testing with docker compose (#29)

chore: setup ci for testing with docker compose (#29) #15

name: Deploy to Sepolia Test Environment
on:
push:
branches:
- sepolia-db
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH into Remote Server and Deploy Changes
uses: appleboy/[email protected]
with:
host: ec2-3-87-142-202.compute-1.amazonaws.com
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: 22
script: |
# Navigate to the project directory
cd ~/fossil-headers-db
# Pull the latest changes from the sepolia-db branch
git fetch origin sepolia-db
git reset --hard origin/sepolia-db
# Ensure Docker and Docker Compose are installed
docker --version || { echo "Docker not found"; exit 1; }
docker-compose --version || { echo "Docker Compose not found"; exit 1; }
# Stop existing Sepolia services
docker-compose -f docker-compose.sepolia.yml --project-name sepolia down
# Build and deploy Sepolia services
docker-compose -f docker-compose.sepolia.yml --env-file .env.sepolia --project-name sepolia build --no-cache
docker-compose -f docker-compose.sepolia.yml --env-file .env.sepolia --project-name sepolia up -d
# Verify running services
docker ps