Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
304 commits
Select commit Hold shift + click to select a range
b29b9a1
update question service
wxwxwxwx9 Oct 3, 2022
10e60ca
Update question service
wxwxwxwx9 Oct 3, 2022
7e0de72
Update auth.js
wxwxwxwx9 Oct 3, 2022
5f1ea1b
Merge pull request #25 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
8548e2e
update
wxwxwxwx9 Oct 3, 2022
f1f4954
Merge pull request #26 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
c77a8f9
Organize and create url file for links
wxwxwxwx9 Oct 3, 2022
0d99d33
Merge pull request #27 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
d87f838
add dockerfile and CD workflows for user and question service
wxwxwxwx9 Oct 3, 2022
37b2709
update test command
wxwxwxwx9 Oct 3, 2022
0fdbd3b
update workflow files
wxwxwxwx9 Oct 3, 2022
cd910d1
Empty-Commit
wxwxwxwx9 Oct 3, 2022
9f7f6e6
update workflow
wxwxwxwx9 Oct 3, 2022
770a697
update workflow
wxwxwxwx9 Oct 3, 2022
b5e9385
Update user-service-deploy.yml
wxwxwxwx9 Oct 3, 2022
4265c48
update
wxwxwxwx9 Oct 3, 2022
1dacb3e
update
wxwxwxwx9 Oct 3, 2022
58266ff
update
wxwxwxwx9 Oct 3, 2022
7fb0755
update CI
wxwxwxwx9 Oct 3, 2022
187be47
dummy push
wxwxwxwx9 Oct 3, 2022
a75f3ca
dummy push
wxwxwxwx9 Oct 3, 2022
74d13b9
update
wxwxwxwx9 Oct 3, 2022
9a26095
Merge pull request #28 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
5ef6dd2
update
wxwxwxwx9 Oct 3, 2022
d478698
update
wxwxwxwx9 Oct 3, 2022
e97ddb0
Merge pull request #29 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
2742898
dummy
wxwxwxwx9 Oct 3, 2022
126a2ec
ss
wxwxwxwx9 Oct 3, 2022
1fa235b
ss
wxwxwxwx9 Oct 3, 2022
301381a
update workflow
wxwxwxwx9 Oct 3, 2022
ffad749
Merge pull request #30 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
7f3b8d2
dummy
wxwxwxwx9 Oct 3, 2022
576ba8c
Merge pull request #31 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
1be0825
update workflow
wxwxwxwx9 Oct 3, 2022
114eeb7
Merge pull request #32 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
3e09512
dummy
wxwxwxwx9 Oct 3, 2022
9b84d80
Merge pull request #33 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
4c02561
update dockerfile and workflows
wxwxwxwx9 Oct 3, 2022
f11edf1
Merge pull request #34 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
4ac3682
update workflow files
wxwxwxwx9 Oct 3, 2022
33b9a33
fix url
wxwxwxwx9 Oct 3, 2022
b03040b
update docker files
wxwxwxwx9 Oct 3, 2022
762035f
Merge pull request #35 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
753967c
dummy
wxwxwxwx9 Oct 3, 2022
a1d1be0
Merge pull request #36 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
58b124b
Update workflows
wxwxwxwx9 Oct 3, 2022
8bdc5ea
update
wxwxwxwx9 Oct 3, 2022
d73718e
Merge pull request #37 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
05fabd9
update dockerfile
wxwxwxwx9 Oct 3, 2022
0166ab5
Merge pull request #38 from wxwxwxwx9/main
wxwxwxwx9 Oct 3, 2022
90798d7
update workflows to deploy to ECS
wxwxwxwx9 Oct 4, 2022
2242e4a
Merge pull request #39 from wxwxwxwx9/main
wxwxwxwx9 Oct 4, 2022
9492274
update workflow
wxwxwxwx9 Oct 4, 2022
a1d718f
Merge pull request #40 from wxwxwxwx9/main
wxwxwxwx9 Oct 4, 2022
5b3b66e
update workflow
wxwxwxwx9 Oct 4, 2022
9916b08
Merge pull request #41 from wxwxwxwx9/main
wxwxwxwx9 Oct 4, 2022
2909485
update workflow
wxwxwxwx9 Oct 4, 2022
f33027f
Merge pull request #42 from wxwxwxwx9/main
wxwxwxwx9 Oct 4, 2022
1216694
Merge branch 'CS3219-AY2223S1:main' into main
cwq2326 Oct 4, 2022
379c151
feat(collaboration-service): Add collaboration service (#43)
nhzaci Oct 4, 2022
6366c6b
refactor(matching-service): Remove room and message functionalities (…
nhzaci Oct 4, 2022
406c51c
Add home page
cwq2326 Oct 4, 2022
573b1f2
Add buttons styling
cwq2326 Oct 4, 2022
da70ea7
Add about page
cwq2326 Oct 4, 2022
c2df533
Add dot to module css
cwq2326 Oct 4, 2022
4bec0a2
Add href to about in home
cwq2326 Oct 4, 2022
83fa3ce
Add hero to routes
cwq2326 Oct 4, 2022
8b09d6f
Add margin top to login and signup
cwq2326 Oct 4, 2022
974eed8
Remove images folder
cwq2326 Oct 4, 2022
ffe44b9
Update logo link
cwq2326 Oct 4, 2022
95ff11b
Update routes
cwq2326 Oct 4, 2022
ab92259
Fix loading page style
cwq2326 Oct 4, 2022
92370c6
Update about page style
cwq2326 Oct 4, 2022
96f15a0
Rename Hero to HeroPage
cwq2326 Oct 4, 2022
911c234
Update nav bar styles for login and register, also remove home
cwq2326 Oct 4, 2022
de3d242
Merge branch 'CS3219-AY2223S1:main' into main
cwq2326 Oct 4, 2022
2eaadfc
Merge pull request #21 from cwq2326/main
cwq2326 Oct 4, 2022
81614aa
integrate question and collab service
wxwxwxwx9 Oct 5, 2022
ac195bc
Merge pull request #45 from wxwxwxwx9/main
wxwxwxwx9 Oct 5, 2022
eb5eef3
Finish connect to question service
cwq2326 Oct 5, 2022
9df10b9
Remove unused variable
cwq2326 Oct 5, 2022
1fb4f3b
Merge pull request #46 from cwq2326/main
cwq2326 Oct 5, 2022
38e20d2
dashboard pash once again
toahi Oct 12, 2022
eb48c21
Merge pull request #47 from toahi/main
toahi Oct 12, 2022
1f8f47b
feat(match): Integrate matching service (#48)
nhzaci Oct 12, 2022
d8b3a61
build(*): Add alias for running servers
nhzaci Oct 14, 2022
96a87b1
Update hero section page
cwq2326 Oct 16, 2022
eef3be6
update 404 page
cwq2326 Oct 16, 2022
7aa1c90
resize doge image in about
cwq2326 Oct 16, 2022
a068e6d
update styling for dashboard
cwq2326 Oct 16, 2022
5a1b93e
remove file
cwq2326 Oct 16, 2022
fea559d
Merge pull request #49 from cwq2326/main
cwq2326 Oct 16, 2022
bc9da0b
add progress bar to modal in dashboard
cwq2326 Oct 16, 2022
82033ea
Merge branch 'CS3219-AY2223S1:main' into main
cwq2326 Oct 16, 2022
8e74598
Merge pull request #50 from cwq2326/main
cwq2326 Oct 16, 2022
4faab9d
Update dashboard to includes card for diffculty
cwq2326 Oct 17, 2022
6483433
Remove AboutPage.module.css
cwq2326 Oct 17, 2022
a3c29bb
Merge pull request #51 from cwq2326/main
cwq2326 Oct 17, 2022
99f407f
fix(match): Fix bug since socket ids are not constant
nhzaci Oct 19, 2022
4d7968f
update timer and add timer to match making and add timeout
cwq2326 Oct 19, 2022
fd97713
Merge pull request #52 from cwq2326/main
cwq2326 Oct 19, 2022
beafc1d
Add docker-compose for all services
wxwxwxwx9 Oct 22, 2022
ac9cc80
fix docker compose dev
wxwxwxwx9 Oct 22, 2022
186aa0c
Merge pull request #53 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
e969add
add CI for collab and match
wxwxwxwx9 Oct 22, 2022
fcb5625
Merge pull request #54 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
ec6ad90
improve ci testing
wxwxwxwx9 Oct 22, 2022
0873b95
Merge pull request #55 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
10be544
update cd
wxwxwxwx9 Oct 22, 2022
295faaa
Merge pull request #56 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
cfb2717
fix deploy job
wxwxwxwx9 Oct 22, 2022
a4c3aef
Merge pull request #57 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
fa76c9b
Update cd.yml
wxwxwxwx9 Oct 22, 2022
b52a136
Merge pull request #58 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
2293d7f
Update cd.yml
wxwxwxwx9 Oct 22, 2022
7dff12e
Update cd.yml
wxwxwxwx9 Oct 22, 2022
1ef9e85
Merge pull request #59 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
520e60a
Update cd.yml
wxwxwxwx9 Oct 22, 2022
becd4de
Merge pull request #60 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
2d22920
add matching and collaboration ecr
wxwxwxwx9 Oct 22, 2022
0571248
Merge pull request #61 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
b3688da
add ecs deploy for matching and collab
wxwxwxwx9 Oct 22, 2022
8bc7727
Merge pull request #62 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
467bc90
update aws config
wxwxwxwx9 Oct 22, 2022
847620c
Merge pull request #63 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
54bd9a3
Update cs3219-project-ay2223s1-g50.json
wxwxwxwx9 Oct 22, 2022
dd07bc6
Merge pull request #64 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
34d3e94
Update cs3219-project-ay2223s1-g50.json
wxwxwxwx9 Oct 22, 2022
08a67bd
Merge pull request #65 from wxwxwxwx9/main
wxwxwxwx9 Oct 22, 2022
db94303
Remove timeout functions properly
cwq2326 Oct 23, 2022
2870432
Add leave button in session
cwq2326 Oct 23, 2022
5bf4907
Add cleartimeout when match found
cwq2326 Oct 23, 2022
e3cc765
Change timeout to 30s
cwq2326 Oct 23, 2022
877b31d
Put questions beside editor
cwq2326 Oct 23, 2022
359a811
Merge pull request #66 from cwq2326/main
cwq2326 Oct 23, 2022
2ec4b51
Add padding to text editor
cwq2326 Oct 23, 2022
3a2e468
Merge pull request #67 from cwq2326/main
cwq2326 Oct 23, 2022
58fa4b5
Dockerize frontend for development
cwq2326 Oct 23, 2022
aa8fead
Make interview session persistent
cwq2326 Oct 25, 2022
a6734ab
Merge pull request #68 from cwq2326/main
cwq2326 Oct 25, 2022
4077f6c
feat(chat): Add chat service (#69)
nhzaci Oct 25, 2022
14edf73
feat(chat): Integrate chat logic
nhzaci Oct 25, 2022
283acab
Update Interview Page
cwq2326 Oct 25, 2022
56970e4
Merge pull request #70 from cwq2326/main
cwq2326 Oct 25, 2022
9224b1d
update dockerfiles
wxwxwxwx9 Oct 25, 2022
24d9591
fix yarn
wxwxwxwx9 Oct 25, 2022
606824e
Update package.json
wxwxwxwx9 Oct 25, 2022
2a383f3
Merge pull request #71 from wxwxwxwx9/main
wxwxwxwx9 Oct 25, 2022
3d7412c
update cd
wxwxwxwx9 Oct 25, 2022
548b86d
Merge pull request #72 from wxwxwxwx9/main
wxwxwxwx9 Oct 25, 2022
8ee68d0
Update package.json
wxwxwxwx9 Oct 25, 2022
239c6fc
Merge pull request #73 from wxwxwxwx9/main
wxwxwxwx9 Oct 25, 2022
9590c3c
fix port bug
wxwxwxwx9 Oct 26, 2022
cbb9aad
Merge pull request #74 from wxwxwxwx9/main
wxwxwxwx9 Oct 26, 2022
72e2284
fix cd bug
wxwxwxwx9 Oct 26, 2022
5251942
Merge pull request #75 from wxwxwxwx9/main
wxwxwxwx9 Oct 26, 2022
905c97b
update env var for frontend
wxwxwxwx9 Oct 26, 2022
634f49c
Merge pull request #76 from wxwxwxwx9/main
wxwxwxwx9 Oct 26, 2022
c97c8d4
Use client to set cookies instead of server
cwq2326 Oct 26, 2022
66ef346
Merge branch 'CS3219-AY2223S1:main' into main
cwq2326 Oct 26, 2022
8831665
Merge pull request #77 from cwq2326/main
cwq2326 Oct 26, 2022
7caf098
Update workflow for SignUp
cwq2326 Oct 26, 2022
7867bdd
Remove sessions from user-service
cwq2326 Oct 26, 2022
4ee0764
Remove sessions from user-service
cwq2326 Oct 26, 2022
ee9cfa3
Format ValidateAuth.js
cwq2326 Oct 26, 2022
8ac7f7b
Merge pull request #78 from cwq2326/main
cwq2326 Oct 26, 2022
aed7f2d
update cors
wxwxwxwx9 Oct 26, 2022
4c44ccf
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
wxwxwxwx9 Oct 26, 2022
67800a4
Update app.js
wxwxwxwx9 Oct 26, 2022
ec0fd06
Update match.socket.ts
wxwxwxwx9 Oct 26, 2022
c124f46
Merge pull request #79 from wxwxwxwx9/main
wxwxwxwx9 Oct 26, 2022
136d4d9
fix question service url
wxwxwxwx9 Oct 26, 2022
6789b2a
Merge pull request #80 from wxwxwxwx9/main
wxwxwxwx9 Oct 26, 2022
30f0406
Update cs3219-project-ay2223s1-g50.json
wxwxwxwx9 Oct 27, 2022
154b2f6
Merge pull request #81 from wxwxwxwx9/main
wxwxwxwx9 Oct 27, 2022
5a3d3b4
update cd
wxwxwxwx9 Oct 27, 2022
bc4998b
Merge pull request #82 from wxwxwxwx9/main
wxwxwxwx9 Oct 27, 2022
1faf7fe
fix(frontend): Fix socket connections using useEffect
nhzaci Oct 27, 2022
faec8eb
Remove ExistingSession.js
cwq2326 Oct 27, 2022
6f7ab2d
Update size of question box
cwq2326 Oct 27, 2022
bc1bb85
Add solution button in question box
cwq2326 Oct 27, 2022
72cb567
Merge pull request #83 from cwq2326/main
cwq2326 Oct 27, 2022
9af7705
feat(frontend): Add startTime into cookie
nhzaci Oct 28, 2022
886fbd3
Merge branch 'main' of github.com:CS3219-AY2223S1/cs3219-project-ay22…
nhzaci Oct 28, 2022
730da63
fix(frontend): Fix logout flow
nhzaci Oct 28, 2022
b136dc4
update frontend for deployment
wxwxwxwx9 Oct 28, 2022
9184f9d
Merge pull request #84 from wxwxwxwx9/main
wxwxwxwx9 Oct 28, 2022
1c1428c
fix frontend dockerfile
wxwxwxwx9 Oct 28, 2022
c49209a
Merge pull request #85 from wxwxwxwx9/main
wxwxwxwx9 Oct 28, 2022
d1d268e
update cd for frontend
wxwxwxwx9 Oct 28, 2022
9f53349
Merge pull request #86 from wxwxwxwx9/main
wxwxwxwx9 Oct 28, 2022
12e103f
fix frontend deploy
wxwxwxwx9 Oct 28, 2022
8441e25
Merge pull request #87 from wxwxwxwx9/main
wxwxwxwx9 Oct 28, 2022
51ff35c
update frontend prod url for CORS
wxwxwxwx9 Oct 28, 2022
19f2360
Merge pull request #88 from wxwxwxwx9/main
wxwxwxwx9 Oct 28, 2022
f2cc0de
Fix error message for login and signup
cwq2326 Oct 29, 2022
e357c2a
Merge branch 'main' of https://github.com/cwq2326/cs3219-project-ay22…
cwq2326 Oct 29, 2022
364bd1d
Merge pull request #89 from cwq2326/main
cwq2326 Oct 29, 2022
0cbb5b5
fix(chat): Fix own chat not showing up
nhzaci Oct 29, 2022
1de80c5
Merge branch 'main' of github.com:CS3219-AY2223S1/cs3219-project-ay22…
nhzaci Oct 29, 2022
eec0d3b
fix(frontend): Fix invalid message model
nhzaci Oct 29, 2022
b64d09e
Update UI for user badge in navbar
cwq2326 Oct 29, 2022
4f74c68
Add different error messages for login
cwq2326 Oct 29, 2022
1f597e9
Merge pull request #90 from cwq2326/main
cwq2326 Oct 29, 2022
453bdf5
Remove get new question functionality in Interview Page
cwq2326 Oct 30, 2022
b267304
Merge pull request #91 from cwq2326/main
cwq2326 Oct 30, 2022
c4a7372
Add difficulty badge in Interview Page
cwq2326 Oct 30, 2022
919e250
Refactor code for clearing time outs
cwq2326 Oct 30, 2022
a77bbfb
Prevent finding match dialog from closing by clicking backdrop
cwq2326 Oct 30, 2022
35cdab9
Merge pull request #92 from cwq2326/main
cwq2326 Oct 30, 2022
0b9062d
Update UI for chat
cwq2326 Oct 30, 2022
b43f531
Merge pull request #93 from cwq2326/main
cwq2326 Oct 30, 2022
0363615
Update return to interview button
cwq2326 Oct 30, 2022
637930f
Add badge to difficulty level in Dashboard
cwq2326 Oct 30, 2022
b88be89
Change icon for chat in Inteview
cwq2326 Oct 30, 2022
d1dcff3
Refactor code for swap display btn
cwq2326 Oct 30, 2022
7445c94
Merge pull request #94 from cwq2326/main
cwq2326 Oct 30, 2022
06290a9
Revert chat icon in Interview page
cwq2326 Oct 30, 2022
3b5d657
Add alert user if the other user has left
cwq2326 Oct 30, 2022
9c0a4ed
Merge branch 'main' of https://github.com/cwq2326/cs3219-project-ay22…
cwq2326 Oct 30, 2022
29207ad
resolve conflict
cwq2326 Oct 30, 2022
ef93aaf
Merge pull request #95 from cwq2326/main
cwq2326 Oct 30, 2022
9b4c766
Separate imports in Dashboard
cwq2326 Oct 30, 2022
ea243bd
Merge pull request #96 from cwq2326/main
cwq2326 Oct 30, 2022
bd26c44
Add functionality to okay btn for user left dialog
cwq2326 Oct 31, 2022
7f55b28
Add confirm leave dialog for leave room btn
cwq2326 Oct 31, 2022
4fe8600
Update message for alerting user has navigated away from interview page
cwq2326 Oct 31, 2022
e17ca3a
Add persistency to chat messages and count
cwq2326 Oct 31, 2022
21e5225
Add checking of cookies enabled or not
cwq2326 Oct 31, 2022
b243133
Merge branch 'fix-bugs'
cwq2326 Oct 31, 2022
d8c3a07
Merge pull request #97 from cwq2326/main
cwq2326 Oct 31, 2022
8e46c89
Fix using existing cookies from exising session
cwq2326 Oct 31, 2022
c9ea706
Merge pull request #98 from cwq2326/main
cwq2326 Oct 31, 2022
2bcd7d9
Format code
cwq2326 Oct 31, 2022
1a1d817
Merge pull request #99 from cwq2326/main
cwq2326 Oct 31, 2022
98561bf
Add persistency to code editor
cwq2326 Nov 1, 2022
18e1f57
Save editor text in cookies
cwq2326 Nov 1, 2022
ec35b81
Merge pull request #100 from cwq2326/main
cwq2326 Nov 1, 2022
00ff663
Format code
cwq2326 Nov 1, 2022
6261b44
Merge pull request #101 from cwq2326/main
cwq2326 Nov 1, 2022
32b6ea3
Clear cookies for editor text for leave btn
cwq2326 Nov 1, 2022
76a33c2
Merge pull request #102 from cwq2326/main
cwq2326 Nov 1, 2022
cd2980e
Refactor code
cwq2326 Nov 1, 2022
20d8e76
Merge pull request #103 from cwq2326/main
cwq2326 Nov 1, 2022
2faa0d6
Add chatbox under questions
cwq2326 Nov 7, 2022
f63128e
Merge pull request #104 from cwq2326/main
cwq2326 Nov 7, 2022
932e091
Fix question box size issue
cwq2326 Nov 7, 2022
cfe042e
Merge pull request #105 from cwq2326/main
cwq2326 Nov 7, 2022
6d8e79d
Create 50-ProjectReport.pdf
wxwxwxwx9 Nov 9, 2022
48a9e41
Merge pull request #106 from wxwxwxwx9/main
wxwxwxwx9 Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
311 changes: 311 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
name: deployments

on:
push:
# Change to release branch
branches: [ "main" ]

jobs:

frontend-ecr:
name: Push Frontend Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }} # only run deployment on master repo and not forks
environment: cs3219-project-ay2223s1-g50 # needed to retrieve the secrets from GH environment

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: frontend
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-frontend
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -f Dockerfile.prod -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

user-service-ecr:
name: Push User Service Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }}
environment: cs3219-project-ay2223s1-g50

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: user-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-user
IMAGE_TAG: ${{ github.sha }}
DB_USERS_CLOUD_URI: ${{ secrets.DB_USERS_CLOUD_URI }}
REDIS_USERS_CLOUD_URI: ${{ secrets.REDIS_USERS_CLOUD_URI }}
JWT_ACCESS_TOKEN_SECRET: ${{ secrets.JWT_ACCESS_TOKEN_SECRET }}
JWT_REFRESH_TOKEN_SECRET: ${{ secrets.JWT_REFRESH_TOKEN_SECRET }}
run: |
docker build -f Dockerfile.prod --build-arg DB_USERS_CLOUD_URI=$DB_USERS_CLOUD_URI --build-arg REDIS_USERS_CLOUD_URI=$REDIS_USERS_CLOUD_URI --build-arg JWT_ACCESS_TOKEN_SECRET=$JWT_ACCESS_TOKEN_SECRET --build-arg JWT_REFRESH_TOKEN_SECRET=$JWT_REFRESH_TOKEN_SECRET -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

question-service-ecr:
name: Push Question Service Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }} # only run deployment on master repo and not forks
environment: cs3219-project-ay2223s1-g50 # needed to retrieve the secrets from GH environment

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: question-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-question
IMAGE_TAG: ${{ github.sha }}
DB_QUESTIONS_CLOUD_URI: ${{ secrets.DB_QUESTIONS_CLOUD_URI }}
run: |
docker build -f Dockerfile.prod --build-arg DB_QUESTIONS_CLOUD_URI=$DB_QUESTIONS_CLOUD_URI -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

matching-service-ecr:
name: Push Matching Service Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }} # only run deployment on master repo and not forks
environment: cs3219-project-ay2223s1-g50 # needed to retrieve the secrets from GH environment

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: matching-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-matching
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -f Dockerfile.prod -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

collaboration-service-ecr:
name: Push Collaboration Service Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }} # only run deployment on master repo and not forks
environment: cs3219-project-ay2223s1-g50 # needed to retrieve the secrets from GH environment

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: collaboration-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-collaboration
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -f Dockerfile.prod -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

chat-service-ecr:
name: Push Chat Service Docker Image to ECR
runs-on: ubuntu-latest

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }} # only run deployment on master repo and not forks
environment: cs3219-project-ay2223s1-g50 # needed to retrieve the secrets from GH environment

outputs:
image: ${{ steps.build-image.outputs.image }}

defaults:
run:
working-directory: chat-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
mask-aws-account-id: 'no' # needed to output the image for deploy-ecs job
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cs3219-project-ay2223s1-g50-chat
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -f Dockerfile.prod -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

deploy-ecs:
name: Deploy all ECR images to ECS
runs-on: ubuntu-latest

needs: [ frontend-ecr, user-service-ecr, question-service-ecr, matching-service-ecr, collaboration-service-ecr, chat-service-ecr ]

if: ${{ github.repository_owner == 'CS3219-AY2223S1' }}
environment: cs3219-project-ay2223s1-g50

steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1

# - name: Download Amazon ECS task definition
# run: |
# aws ecs describe-task-definition --task-definition cs3219-project-ay2223s1-g50 --query taskDefinition > cs3219-project-ay2223s1-g50.json

- name: Fill in the new Frontend image ID in the Amazon ECS task definition
id: render-frontend-container
uses: aws-actions/[email protected]
with:
task-definition: cs3219-project-ay2223s1-g50.json
container-name: frontend
image: ${{ needs.frontend-ecr.outputs.image }}
- name: Fill in the new User Service image ID in the Amazon ECS task definition
id: render-user-service-container
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-frontend-container.outputs.task-definition }}
container-name: user-service
image: ${{ needs.user-service-ecr.outputs.image }}
- name: Fill in the new Question Service image ID in the Amazon ECS task definition
id: render-question-service-container
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-user-service-container.outputs.task-definition }}
container-name: question-service
image: ${{ needs.question-service-ecr.outputs.image }}
- name: Fill in the new Matching Service image ID in the Amazon ECS task definition
id: render-matching-service-container
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-question-service-container.outputs.task-definition }}
container-name: matching-service
image: ${{ needs.matching-service-ecr.outputs.image }}
- name: Fill in the new Collaboration Service image ID in the Amazon ECS task definition
id: render-collaboration-service-container
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-matching-service-container.outputs.task-definition }}
container-name: collaboration-service
image: ${{ needs.collaboration-service-ecr.outputs.image }}
- name: Fill in the new Chat Service image ID in the Amazon ECS task definition
id: render-chat-service-container
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-collaboration-service-container.outputs.task-definition }}
container-name: chat-service
image: ${{ needs.chat-service-ecr.outputs.image }}

- name: Deploy updated Amazon ECS task definition
uses: aws-actions/[email protected]
with:
task-definition: ${{ steps.render-chat-service-container.outputs.task-definition }}
service: cs3219-project-ay2223s1-g50-service-new
cluster: cs3219-project-ay2223s1-g50-cluster-new
wait-for-service-stability: true
- name: Echo Success
run: echo Successfully deployed microservice images to ECS!
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

# Consider using paths filter to only trigger jobs when there are changes in the working directory
# This will speed up CI in pull requests
# https://github.com/dorny/paths-filter

# can add frontend tests also

user-service-test:
name: User Service test
runs-on: ubuntu-latest
defaults:
run:
working-directory: user-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run tests
run: |
npm ci
npm test
question-service-test:
name: Question Service test
runs-on: ubuntu-latest
defaults:
run:
working-directory: question-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run tests
run: |
npm ci
npm test
matching-service-test:
name: Matching Service test
runs-on: ubuntu-latest
defaults:
run:
working-directory: matching-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run tests
run: |
yarn
yarn test
collaboration-service-test:
name: Collaboration Service test
runs-on: ubuntu-latest
defaults:
run:
working-directory: collaboration-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run tests
run: |
yarn
yarn test
chat-service-test:
name: Chat Service test
runs-on: ubuntu-latest
defaults:
run:
working-directory: chat-service
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run tests
run: |
yarn
yarn test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.env
.DS_Store
dump.rdb
Loading