Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoon0221 authored Nov 23, 2024
1 parent ba5697f commit 41bfd5b
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ jobs:
run: chmod +x ./gradlew

- name: Build project
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SERVER_SSL_KEY_STORE: ${{ secrets.SERVER_SSL_KEY_STORE }}
SERVER_SSL_KEY_STORE_PASSWORD: ${{ secrets.SERVER_SSL_KEY_STORE_PASSWORD }}
OAUTH_GOOGLE_CLIENT_ID: ${{ secrets.OAUTH_GOOGLE_CLIENT_ID }}
OAUTH_GOOGLE_CLIENT_SECRET: ${{ secrets.OAUTH_GOOGLE_CLIENT_SECRET }}
OAUTH_KAKAO_CLIENT_ID: ${{ secrets.OAUTH_KAKAO_CLIENT_ID }}
OAUTH_KAKAO_CLIENT_SECRET: ${{ secrets.OAUTH_KAKAO_CLIENT_SECRET }}
OAUTH_NAVER_CLIENT_ID: ${{ secrets.OAUTH_NAVER_CLIENT_ID }}
OAUTH_NAVER_CLIENT_SECRET: ${{ secrets.OAUTH_NAVER_CLIENT_SECRET }}
run: ./gradlew clean build

- name: Copy JAR to remote server
Expand All @@ -53,30 +38,9 @@ jobs:
scp build/libs/demo-0.0.1-SNAPSHOT.jar mykeyhost:~/

- name: Deploy application
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SERVER_SSL_KEY_STORE: ${{ secrets.SERVER_SSL_KEY_STORE }}
SERVER_SSL_KEY_STORE_PASSWORD: ${{ secrets.SERVER_SSL_KEY_STORE_PASSWORD }}
OAUTH_GOOGLE_CLIENT_ID: ${{ secrets.OAUTH_GOOGLE_CLIENT_ID }}
OAUTH_GOOGLE_CLIENT_SECRET: ${{ secrets.OAUTH_GOOGLE_CLIENT_SECRET }}
OAUTH_KAKAO_CLIENT_ID: ${{ secrets.OAUTH_KAKAO_CLIENT_ID }}
OAUTH_KAKAO_CLIENT_SECRET: ${{ secrets.OAUTH_KAKAO_CLIENT_SECRET }}
OAUTH_NAVER_CLIENT_ID: ${{ secrets.OAUTH_NAVER_CLIENT_ID }}
OAUTH_NAVER_CLIENT_SECRET: ${{ secrets.OAUTH_NAVER_CLIENT_SECRET }}
run: |
set -x # 명령어를 실행할 때마다 출력
ssh mykeyhost << 'EOF'
sudo pkill -f 'java -jar' || true
sudo nohup java -jar ~/demo-0.0.1-SNAPSHOT.jar \
--server.ssl.key-store=$SERVER_SSL_KEY_STORE \
--server.ssl.key-store-password=$SERVER_SSL_KEY_STORE_PASSWORD \
--server.port=443 \
--jwt.secret-key=$JWT_SECRET_KEY \
--aws.access-key-id=$AWS_ACCESS_KEY_ID \
--aws.secret-access-key=$AWS_SECRET_ACCESS_KEY > app.log 2>&1 &
sudo nohup java -jar ~/demo-0.0.1-SNAPSHOT.jar --server.port=443 > app.log 2>&1 &
EOF

0 comments on commit 41bfd5b

Please sign in to comment.