forked from boostcampwm-2022/web01-knoticle
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1001 Bytes
/
backend-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Backend CD
on:
push:
branches: [main]
paths:
- 'backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Generate Environment Variables
run: |
echo "$BACKEND_ENV" >> .env.production
env:
CI: false
BACKEND_ENV: '${{ secrets.BACKEND_ENV }}'
- name: Transfer Environment Variables with SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: '.env.production'
target: 'knoticle/backend/env'
- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: ${{ secrets.SSH_BACKEND_SCRIPT }}