-
Notifications
You must be signed in to change notification settings - Fork 7
108 lines (99 loc) · 2.8 KB
/
main.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: main
on: [push, pull_request]
jobs:
setup_stage:
runs-on: ubuntu-latest
steps:
- run: ls ~/
- name: Checkout
uses: actions/checkout@v3.6.0
- name: Cache Initial Setup
uses: actions/cache@v3.3.2
with:
path: |
/home/runner/work/neiist-website/neiist-website
key: initial-setup-${{ runner.os }}
- run: ls ~/
client_dependencies:
needs:
- setup_stage
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v3.8.2
with:
node-version: "16"
- name: Cache Client Dependencies
uses: actions/cache@v3.3.2
with:
path: |
/home/runner/work/neiist-website/neiist-website/client
key: initial-setup-${{ runner.os }}
- name: Install client dependencies
run: |
cd client
npm install
cd ..
client_build:
needs:
- client_dependencies
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v3.8.2
with:
node-version: "16"
- name: Build client
run: |
cd client
npm run build
cd ..
server_dependencies:
needs:
- setup_stage
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v3.8.2
with:
node-version: "16"
- name: Install server dependencies
run: |
cd server
npm install
cd ..
client_testing:
needs:
- client_build
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v3.8.2
with:
node-version: "16"
- name: Frontend Tests
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' || github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
cd client
npm run test
cd ..
server_testing:
needs:
- server_dependencies
runs-on: ubuntu-latest
steps:
- name: Frontend Tests
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' || github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
echo "TBD"
deploy:
if: ${{ github.event_name == 'push' && github.event.pull_request.base.ref == 'deploy' || github.event_name == 'push' && github.ref == 'refs/heads/deploy' }}
needs:
- client_testing
- server_testing
runs-on: ubuntu-latest
steps:
- name: SSH Server
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' || github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
echo "TBD"