-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Sepolia deployment workflow
- 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
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |