Skip to content

Commit

Permalink
edit connection, build backend only
Browse files Browse the repository at this point in the history
  • Loading branch information
katelovestocode committed Dec 12, 2023
1 parent e49fcbf commit 8d6d2ae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to EC2 from Develop
on:
push:
branches:
- develop
- BE-20-connect-to-AWS

jobs:
Deploy:
Expand All @@ -12,7 +12,7 @@ jobs:
- name: Clone Repository
uses: actions/checkout@v3
with:
ref: develop
ref: BE-20-connect-to-AWS

- name: Executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
Expand All @@ -24,10 +24,9 @@ jobs:
script: |
set -x
cd app/backend-internship
git checkout develop
sudo chown ubuntu redis/data/dump.rdb
git stash save "Stashing changes to dump.rdb"
git pull origin develop
git checkout BE-20-connect-to-AWS
git pull origin BE-20-connect-to-AWS
echo "PORT=${{ secrets.PORT }}" > .env
echo "HOST=${{ secrets.HOST }}" >> .env
echo "NODE_ENV=${{ secrets.NODE_ENV }}" >> .env
Expand All @@ -44,7 +43,9 @@ jobs:
echo "AUTH0_ISSUER_URL=${{ secrets.AUTH0_ISSUER_URL }}" >> .env
echo "REDIS_URL=${{ secrets.REDIS_URL }}" >> .env
echo "AUTH0_JWKS_URL=${{ secrets.AUTH0_JWKS_URL }}" >> .env
docker-compose stop backend
docker-compose rm -f backend
sudo chmod -R 777 pgdata
docker-compose up --build -d
docker stop backend-prod || true
docker rm backend-prod || true
docker rmi backend-image-prod || true
docker build -t backend-image-prod --progress=plain --no-cache --target prod .
docker run -d -p 3002:3002 --name backend-prod backend-image-prod
6 changes: 6 additions & 0 deletions db/typeorm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ export default new DataSource({
synchronize: false,
migrationsTableName: 'migrations',
logging: ['query', 'error'],
ssl: true,
extra: {
ssl: {
rejectUnauthorized: false,
}
}
})
Binary file modified redis/data/dump.rdb
Binary file not shown.

0 comments on commit 8d6d2ae

Please sign in to comment.