-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.37 KB
/
deploy-backend.yaml
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
name: deploy-back
on:
push:
branches:
- main
paths:
- server/src/**
- server/deploy.sh
- server/test-prod.sh
- server/Dockerfile
- server/requirements.txt
jobs:
deployment:
environment: server
runs-on: ubuntu-latest
steps:
- name: git-clone
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: dependencies
uses: docker/setup-buildx-action@v2
- name: deploy
run: |
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
export AWS_DEFAULT_REGION='us-west-2'
sudo apt-get -y update
sudo apt-get -y install awscli
cd server
./deploy.sh
# Run this job 5 minutes after the previous job
test-deployment:
needs: deployment
runs-on: ubuntu-latest
steps:
- name: git-clone
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install curl jq git-lfs
git lfs install
git lfs pull --include="server/test-data/CPSC331/CPSC331.pdf"
- name: test
# Give the lambda function time to deploy
run: |
sleep 120
cd server
./test-prod.sh