Skip to content

Commit

Permalink
using secrets in application.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dh28be committed May 31, 2024
1 parent b01e792 commit 1922628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/testAndDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,21 @@ jobs:
- name: SSH and deploy
uses: appleboy/ssh-action@master
env:
APPLICATION_YML: ${{ secrets.APPLICATION_YML }}
with:
host: ${{ secrets.KIRBY_SERVER_HOST }}
username: ${{ secrets.KIRBY_SERVER_USERNAME }}
password: ${{ secrets.KIRBY_SERVER_PASSWORD }}
port: ${{ secrets.KIRBY_SERVER_PORT }}
script: |
cd old
cd unistMeal_backend
cd unistMeal-backend
cd old/unistMeal_backend/unistMeal-backend
git pull || exit 1
docker stop unist-meal-backend || exit 1
docker container rm unist-meal-backend || exit 1
docker build -t unist-meal-backend:latest . || exit 1
docker run -d --name unist-meal-backend --net host -e TZ=Asia/Seoul -e secretKey=${{ secrets.SECRET_KEY }} unist-meal-backend:latest || exit 1
docker run -d --name unist-meal-backend --net host -e TZ=Asia/Seoul \
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \
-e DATABASE_USERNAME=${{ secrets.DATABASE_USERNAME }} \
-e DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }} \
-e SECRET_KEY=${{ secrets.SECRET_KEY }} \
unist-meal-backend:latest || exit 1
exit
10 changes: 5 additions & 5 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ spring:
config:
activate:
on-profile: default, development
secretKey: someUpdateKeyToChangeWhereYouWantToChangeMenu
secretKey: ${SECRET_KEY}
---
spring:
config:
activate:
on-profile: production
datasource:
url: jdbc:mysql://localhost:3306/mealu
username: root
password: keredonaiwakatachiniuta
secretKey: someUpdateKeyToChangeWhereYouWantToChangeMenu
url: ${DATABASE_URL}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
secretKey: ${SECRET_KEY}
---
spring:
profiles:
Expand Down

0 comments on commit 1922628

Please sign in to comment.