-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.38 KB
/
deployment.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
# here we define a workflow with two jobs
# the two jobs will run in parallel
# this may not be ideal
# typically you would want your tests to pass before
# deploying the code
name: Deploy Project
# a workflow can have multiple triggers
# here we will set the trigger to both push and
# workflow_dispatch (manual)
on: [push, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Get code from repository
uses: actions/[email protected]
- name: Install NodeJS
uses: actions/[email protected]
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
deploy:
# the deploy job needs the
# test job to finish before
# it starts.
# needs: [test, foo, bar] to wait for multiple
needs: test
runs-on: ubuntu-latest
steps:
- name: Get code from repository
uses: actions/[email protected]
- name: Install NodeJS
uses: actions/[email protected]
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Deploy
run: echo "Deploying to AWS"