Skip to content

Commit

Permalink
ci: add remove .env && add deploy env.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin52 committed Dec 5, 2023
1 parent c1b03cf commit 7d9b112
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy env file

on:
workflow_dispatch:
push:
branches:
- deploy-test

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: oracle deployment
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
port: ${{ secrets.OCI_PORT }}
username: ${{ secrets.OCI_USER }}
key: ${{ secrets.OCI_KEY }}
host: ${{ secrets.OCI_IP }}
script: |
cd /home/opc/backend
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}
MYSQL_DATABASE=${{ secrets.MYSQL_DATABASE }}
MYSQL_USER=${{ secrets.MYSQL_USER }}
MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }}
BACKUP_USER=${{ secrets.BACKUP_USER}}
BACKUP_PASSWORD=${{ secrets.BACKUP_PASSWORD }}
ADMIN_SLACK_ID=${{ secrets.ADMIN_SLACK_ID }}
DB_SCHEMA=${{ secrets.DB_SCHEMA }}
MODE=${{ secrets.MODE }}
NODE_ENV=${{ secrets.NODE_ENV }}
CLIENT_ID=${{ secrets.CLIENT_ID }}
CLIENT_SECRET=${{ secrets.CLIENT_SECRET }}
REDIRECT_URL=${{ secrets.REDIRECT_URL }}
CLIENT_URL=${{ secrets.CLIENT_URL }}
BOT_USER_OAUTH_ACCESS_TOKEN=${{ secrets.BOT_USER_OAUTH_ACCESS_TOKEN }}
JWT_SECRET=${{ secrets.JWT_SECRET }}
NAVER_BOOK_SEARCH_CLIENT_ID=${{ secrets.NAVER_BOOK_SEARCH_CLIENT_ID }}
NATION_LIBRARY_KEY=${{ secrets.NATION_LIBRARY_KEY }}
NAVER_BOOK_SEARCH_SECRET=${{ secrets.NAVER_BOOK_SEARCH_SECRET }}
" > .env
sudo docker compose down
sudo docker compose up -d --build
sudo docker system prune -f
rm -f .env
1 change: 1 addition & 0 deletions .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ jobs:
sudo docker compose down
sudo docker compose up -d --build
sudo docker system prune -f
rm -f .env

0 comments on commit 7d9b112

Please sign in to comment.