generated from agiledev-students-fall2023/generic-project-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (50 loc) · 1.31 KB
/
ci.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
name: CI/CD Pipeline
on:
push:
branches:
- cicd
pull_request:
branches:
- cicd
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js (for front-end)
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install front-end dependencies
run: |
cd front-end
npm install
- name: Install back-end dependencies
run: |
cd back-end
npm install
- name: List contents of the models directory
run: ls -l ./back-end/models/
# - name: Run back-end tests
# run: |
# cd back-end
# npm test
# - name: Build and run Docker containers
# run: docker-compose up --build
- name: Deploy React and Express App
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DROPLET_IP }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
username: ${{ secrets.SSH_USER }}
script: |
cd 4-final-project-group-bill-splitting-app
git pull
cd front-end
npm install
npm start
cd ../back-end
npm install
npm start
echo 'Success'