-
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.
* Working on Github Actions. * Working on Deployment. * Fix: Github Actions. * Fixed username. * Working on deployment. * Update clone-and-setup.yml * Update clone-and-setup.yml * Update clone-and-setup.yml * sanity commit. * snaity commit. * s. * sc. * logging. * Update app-deployment.yml * Update app-deployment.yml * Update db-operations.yml * Update db-operations.yml * Update db-operations.yml * Update db-operations.yml * Update db-operations.yml * Removing unused classes. * Update db-operations.yml * Update db-operations.yml * Update app-deployment.yml * Update app-deployment.yml * Working on deployment. * Update db-operations.yml * Update db-operations.yml * Update package.json * Working on Deployment migration runner. * Fixing docker network. * sc * Working on UI fixes. * Working on QR Download and schema changes. * Working on decoupling action from formData. * Minor changes. * Logging the migrations. * Debugging. * changing env name. * Update app-deployment.yml
- Loading branch information
Showing
31 changed files
with
902 additions
and
167 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,47 @@ | ||
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 up ondc_deep_link_app -d --build | ||
sudo docker system prune -f | ||
echo "BUILD Complete; Restarting Nginx" | ||
sudo systemctl restart nginx | ||
echo "Deployment COMPLETE" | ||
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,29 @@ | ||
name: Database Operations | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
db-reset-and-migrate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Execute Generator DB Operations | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PEM }} | ||
port: 22 | ||
script: | | ||
cd deeplink-resolver-server/deeplink-generator | ||
echo "DB Teardown and Restart" | ||
sudo docker compose down ondc_deep_link_db | ||
sudo docker compose up -d ondc_deep_link_db | ||
sleep 10 | ||
sudo docker build -t migrations-runner -f Dockerfile.migration . | ||
sudo docker run --rm \ | ||
--network deeplink-generator_default \ | ||
migrations-runner | ||
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 |
---|---|---|
|
@@ -38,3 +38,5 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
docker-compose.yml | ||
|
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,10 @@ | ||
FROM node:22-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY . . | ||
|
||
RUN npm install | ||
|
||
CMD ["sh", "-c", "npx prisma generate && npx prisma migrate deploy && node seeding/seed.js"] |
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,25 @@ | ||
services: | ||
ondc_deep_link_app: | ||
build: . | ||
ports: | ||
- "8080:3000" | ||
env_file: | ||
- ./.env | ||
depends_on: | ||
- ondc_deep_link_db | ||
|
||
ondc_deep_link_db: | ||
image: postgres | ||
restart: always | ||
# set shared memory limit when using docker-compose | ||
shm_size: 128mb | ||
# or set shared memory limit when deploy via swarm stack | ||
#volumes: | ||
# - type: tmpfs | ||
# target: /dev/shm | ||
# tmpfs: | ||
# size: 134217728 # 128*2^20 bytes = 128Mb | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- ./.env |
File renamed without changes.
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import type { NextConfig } from "next"; | ||
|
||
const nextConfig: NextConfig = { | ||
/* config options here */ | ||
output: "standalone" | ||
/* config options here */ | ||
output: "standalone", | ||
images: { | ||
remotePatterns: [ | ||
{ protocol: "https", hostname: "raw.githubusercontent.com" }, | ||
], | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
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
Oops, something went wrong.