-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (41 loc) · 1.17 KB
/
stage.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
on:
push:
branches:
- stage
name: Update EC2
jobs:
update:
name: Prod - SSH Login, Pull, Reload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/[email protected]
with:
node-version: "19.x"
- run: npm install
- run: npx prisma generate
- run: npm run build
- name: copy file via ssh password
uses: appleboy/[email protected]
with:
host: ec2-52-34-213-210.us-west-2.compute.amazonaws.com
username: ubuntu
key: ${{ secrets.CARSONS_AWS_API_PRIVATE_KEY }}
source: ./.output
target: ~/carsons-village-stage
overwrite: true
- name: Execute
uses: appleboy/[email protected]
with:
script: |
cd carsons-village-stage
git checkout stage
git pull
npm install
cp .env ./.output/server/.env
npx prisma migrate deploy
pm2 restart all
host: ec2-52-34-213-210.us-west-2.compute.amazonaws.com
username: ubuntu
key: ${{ secrets.CARSONS_AWS_API_PRIVATE_KEY }}