Skip to content

Commit 21c1eba

Browse files
committed
feat: env 파일 생성 및 sh 실행
1 parent eff74a0 commit 21c1eba

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
# 코드 체크아웃
4444
- name: Checkout code
4545
uses: actions/checkout@v3
46+
47+
# .env 파일 생성 후 붙여넣기
48+
- name: Create .env file
49+
run: |
50+
echo "${{secrets.DEVELOPMENT_ENV}}" > ./.env
51+
4652
# 배포용 쉘 스크립트 파일 전송
4753
- name: Copy deploy.sh to remote server
4854
uses: appleboy/scp-action@master
@@ -51,4 +57,13 @@ jobs:
5157
username: ${{ secrets.REMOTE_USER }}
5258
key: ${{ secrets.REMOTE_PRIVATE_KEY }}
5359
source: ./deploy.sh
54-
target: /home/root/deploy.sh
60+
target: /home/root
61+
# 쉘 스크립트 실행
62+
- name: Run command on remote server
63+
uses: appleboy/[email protected]
64+
with:
65+
host: ${{ secrets.REMOTE_DEV_IP }}
66+
username: ${{ secrets.REMOTE_USER }}
67+
key: ${{ secrets.PRIVATE_KEY }}
68+
script: |
69+
sh /home/root/deploy.sh

deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131

3232
# 의존성 설치 및 애플리케이션 시작
3333
echo "의존성 설치 중..."
34-
npm install
34+
yarn install
3535

3636
echo "애플리케이션 시작 중..."
37-
nohup npm start &
37+
nohup yarn start &

0 commit comments

Comments
 (0)