-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) Β· 2.8 KB
/
deploy.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CD
on:
push:
branches: [main, be-develop]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout...
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install package
run: |
cd BE
npm ci
- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker
run: |
cd BE
docker build -f Dockerfile -t traveline/traveline-docker .
- name: Push Docker
run: |
cd BE
docker push traveline/traveline-docker:latest
- name: SSH Login
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
sudo docker login --username ${{ secrets.DOCKER_ID }} --password ${{ secrets.DOCKER_PASSWORD }}
sudo docker pull traveline/traveline-docker
sudo docker stop traveline-container || true
sudo docker rm traveline-container || true
sudo docker run -e DB_HOST=${{ secrets.DB_HOST }} \
-e DB_PORT=${{ secrets.DB_PORT }} \
-e DB_USER=${{ secrets.DB_USER }} \
-e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e DB_DATABASE=${{ secrets.DB_DATABASE }} \
-e NCP_ACCESS_KEY_ID=${{ secrets.NCP_ACCESS_KEY_ID }} \
-e NCP_SECRET_ACCESS_KEY=${{ secrets.NCP_SECRET_ACCESS_KEY }} \
-e NCP_REGION=${{ secrets.NCP_REGION }} \
-e JWT_SECRET_ACCESS=${{ secrets.JWT_SECRET_ACCESS }} \
-e JWT_SECRET_REFRESH=${{ secrets.JWT_SECRET_REFRESH }} \
-e CLIENT_ID=${{ secrets.CLIENT_ID }} \
-e TEAM_ID=${{ secrets.TEAM_ID }} \
-e KEY_ID=${{ secrets.KEY_ID }} \
-e AUTH_KEY_LINE1=${{ secrets.AUTH_KEY_LINE1 }} \
-e AUTH_KEY_LINE2=${{ secrets.AUTH_KEY_LINE2 }} \
-e AUTH_KEY_LINE3=${{ secrets.AUTH_KEY_LINE3 }} \
-e AUTH_KEY_LINE4=${{ secrets.AUTH_KEY_LINE4 }} \
-e KAKAO_REST_API_KEY=${{ secrets.KAKAO_REST_API_KEY }} \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e AWS_REGION=${{ secrets.AWS_REGION }} \
-e GREENEYE_SECRET_KEY=${{ secrets.GREENEYE_SECRET_KEY }} \
-e GREENEYE_DOMAIN_ID=${{ secrets.GREENEYE_DOMAIN_ID }} \
-e GREENEYE_SIGNATURE=${{ secrets.GREENEYE_SIGNATURE }} \
-d -p ${{secrets.EXTERNAL_PORT}}:${{secrets.INTERNAL_PORT}} --name traveline-container traveline/traveline-docker