-
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: update Sepolia deployment workflow for isolated environment setup
- Updated `sepolia.deploy` workflow to ensure proper isolation using `--project-name sepolia`. - Integrated `.env.sepolia` file for environment-specific variables. - Added commands to stop existing Sepolia services before deployment for a clean setup. - Ensured Docker Compose builds and deploys Sepolia services with no conflicts. - Included verification step to list running services after deployment. This change ensures Sepolia services run independently without interfering with other environments (e.g., Mainnet).
- Loading branch information
Showing
4 changed files
with
41 additions
and
44 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
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 |
---|---|---|
|
@@ -12,43 +12,30 @@ jobs: | |
steps: | ||
- name: SSH into Remote Server and Deploy Changes | ||
uses: appleboy/[email protected] | ||
env: | ||
SEPOLIA_DB_STRING: ${{ secrets.SEPOLIA_DB_STRING }} | ||
SEPOLIA_NODE_STRING: ${{ secrets.SEPOLIA_NODE_STRING }} | ||
SEPOLIA_ROUTER_ENDPOINT: ${{ secrets.SEPOLIA_ROUTER_ENDPOINT }} | ||
SEPOLIA_POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
SEPOLIA_POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
SEPOLIA_POSTGRES_DB: ${{ secrets.SEPOLIA_POSTGRES_DB }} | ||
with: | ||
host: ec2-3-87-142-202.compute-1.amazonaws.com | ||
username: ubuntu | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.SSH_PASSPHRASE }} | ||
port: 22 | ||
envs: SEPOLIA_DB_STRING,SEPOLIA_NODE_STRING,SEPOLIA_ROUTER_ENDPOINT,SEPOLIA_POSTGRES_USER,SEPOLIA_POSTGRES_PASSWORD,SEPOLIA_POSTGRES_DB | ||
script: | | ||
# Navigate to the project directory | ||
cd ~/fossil-headers-db | ||
# Pull the latest changes from the sepolia branch | ||
# Pull the latest changes from the sepolia-db branch | ||
git fetch origin sepolia-db | ||
git reset --hard origin/sepolia-db | ||
# Create or update .env file with the environment variables | ||
cat > .env << EOL | ||
SEPOLIA_DB_STRING=${SEPOLIA_DB_STRING} | ||
SEPOLIA_NODE_STRING=${SEPOLIA_NODE_STRING} | ||
SEPOLIA_ROUTER_ENDPOINT=${SEPOLIA_ROUTER_ENDPOINT} | ||
SEPOLIA_POSTGRES_USER=${SEPOLIA_POSTGRES_USER} | ||
SEPOLIA_POSTGRES_PASSWORD=${SEPOLIA_POSTGRES_PASSWORD} | ||
SEPOLIA_POSTGRES_DB=${SEPOLIA_POSTGRES_DB} | ||
EOL | ||
# 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 | ||
# Stop any existing Sepolia services | ||
docker-compose --project-name sepolia down | ||
# Build and deploy Sepolia services | ||
docker-compose --env-file .env.sepolia --project-name sepolia build --no-cache | ||
docker-compose --env-file .env.sepolia --project-name sepolia up -d | ||
# Verify running services | ||
docker ps |
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
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