Skip to content

Commit

Permalink
feat: Add Sepolia deployment workflow
Browse files Browse the repository at this point in the history
- Add separate GitHub Actions workflow for Sepolia testnet
- Configure deployment to trigger on sepolia branch pushes
- Update git commands to pull from sepolia branch
- Maintain separate deployment pipeline from mainnet
  • Loading branch information
ametel01 committed Dec 3, 2024
1 parent 3674025 commit 55f5642
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.sepolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to Remote Server

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 main branch
git fetch origin main
git reset --hard origin/main
# 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; }
# Build and run the Docker Compose services for Sepolia
docker-compose -f docker-compose.sepolia.yml down
docker-compose -f docker-compose.sepolia.yml build --no-cache
docker-compose -f docker-compose.sepolia.yml up -d
45 changes: 45 additions & 0 deletions docker-compose.sepolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3.8'

services:
update:
build:
dockerfile: Dockerfile.update
context: .
ports:
- "8081:8080"
environment:
- DB_CONNECTION_STRING=${SEPOLIA_DB_STRING}
- NODE_CONNECTION_STRING=${SEPOLIA_NODE_STRING}
- ROUTER_ENDPOINT=${SEPOLIA_ROUTER_ENDPOINT}
- RUST_LOG=info
depends_on:
db:
condition: service_healthy

fix:
build:
dockerfile: Dockerfile.fix
context: .
environment:
- DB_CONNECTION_STRING=${SEPOLIA_DB_STRING}
- NODE_CONNECTION_STRING=${SEPOLIA_NODE_STRING}
- ROUTER_ENDPOINT=${SEPOLIA_ROUTER_ENDPOINT}
- RUST_LOG=info
- INTERVAL=${FIX_INTERVAL:-300}
depends_on:
db:
condition: service_healthy

db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${SEPOLIA_POSTGRES_DB}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 5

0 comments on commit 55f5642

Please sign in to comment.