Skip to content

Fix: Migration runner (#16) #10

Fix: Migration runner (#16)

Fix: Migration runner (#16) #10

name: App Deployment
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
deploy-app:
runs-on: ubuntu-latest
steps:
- name: Deploy Generator App
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PEM }}
port: 22
script: |
echo "STARTING Deployment"
[ -d "deeplink-resolver-server" ] && sudo rm -rf "deeplink-resolver-server"
sudo git clone https://github.com/abhik-wil/deeplink-resolver-server.git
cd deeplink-resolver-server/deeplink-generator
echo "STARTING Deployment"
sudo touch .env
# Create backend .env file
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" | sudo tee .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" | sudo tee -a .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" | sudo tee -a .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" | sudo tee -a .env
echo "ACCESS_TOKEN_REPO=${{ secrets.ACCESS_TOKEN_REPO }}" | sudo tee -a .env
echo "OWNER_NAME_REPO=${{ secrets.OWNER_NAME_REPO }}" | sudo tee -a .env
echo "STORAGE_REPO_NAME=${{ secrets.STORAGE_REPO_NAME }}" | sudo tee -a .env
echo "STARTING build"
sudo cp docker-compose.dev.yml docker-compose.yml
sudo docker compose build --no-cache ondc_deep_link_app && sudo docker compose up -d ondc_deep_link_app
sudo docker system prune -f
echo "BUILD Complete; Restarting Nginx"
sudo systemctl restart nginx
echo "Deployment COMPLETE"