Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 628 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
628 commits
Select commit Hold shift + click to select a range
d2f3f5d
Implement transition between category pages
kohkaixun Oct 23, 2023
7bd2d78
Implement mass delete catgories
kohkaixun Oct 23, 2023
f09c74d
Remove commented code
kohkaixun Oct 23, 2023
a6fa8ba
Fix dockerfile
zzthian Oct 24, 2023
27c2e82
Merge upstream to local
zzthian Oct 24, 2023
071f79f
Format the video nicely on the room page
zzthian Oct 24, 2023
89be29c
Make getting questions less restrictive
zzthian Oct 24, 2023
80c10ef
Merge branch 'deployment'
zzthian Oct 24, 2023
054aeb2
Merge pull request #51 from zzthian/master
ChangGittyHub Oct 24, 2023
16c740f
Implement search bar by category
kohkaixun Oct 25, 2023
43f5410
Relabel find bar
kohkaixun Oct 25, 2023
713fa37
Create node.js.yml
adam07018 Oct 25, 2023
16e511e
Update to questions rendering
kohkaixun Oct 25, 2023
d874280
Rectify ViewQuestion after udpates
kohkaixun Oct 25, 2023
8a02dd1
Merge branch 'master' into category-tags
kohkaixun Oct 25, 2023
8d3de15
Add question and edit category button admin view
kohkaixun Oct 25, 2023
ed5a384
Add comments in index.js for question backend
kohkaixun Oct 25, 2023
9a5332a
Reformat code
kohkaixun Oct 25, 2023
5e26576
Change frontend Dockerfile
kohkaixun Oct 26, 2023
7d2d812
Created socket for questions and added getQuestionByComplexitiy file
ChangGittyHub Oct 26, 2023
ffb59e7
Create test case for createUser and getUser
adam07018 Oct 26, 2023
a761dc7
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 26, 2023
91d7da1
Create test cases for delete user
adam07018 Oct 27, 2023
f01ee2d
Update CI version for nodejs to 20
adam07018 Oct 27, 2023
1d77ee2
Connected question database to Room.js
ChangGittyHub Oct 27, 2023
78ae2bf
git status
zzthian Oct 27, 2023
5ecf34e
Change dockerfiles back again
zzthian Oct 27, 2023
1cca7c2
Create aws.yml
zzthian Oct 27, 2023
ad7d515
Merge pull request #52 from kohkaixun/category-tags
zzthian Oct 27, 2023
9afd3fc
Merge pull request #53 from CS3219-AY2324S1/zzthian-cicd
kohkaixun Oct 27, 2023
3b9419b
Small change
zzthian Oct 27, 2023
a513ae7
Add workflow file
zzthian Oct 27, 2023
54bc501
Change workflow file
zzthian Oct 27, 2023
5ed5190
Change workflow file
zzthian Oct 27, 2023
aaa9be0
Change workflow file
zzthian Oct 27, 2023
9d36040
Add task definition file and correct path
zzthian Oct 27, 2023
e7da7f3
Temporarily commented out the ENV variables in the
ChangGittyHub Oct 28, 2023
11548d5
Merge branch 'questions_branch'
ChangGittyHub Oct 28, 2023
5a4cf3e
Change docker file
adam07018 Oct 28, 2023
c1761d8
Change ci file
adam07018 Oct 28, 2023
6914fca
a
adam07018 Oct 28, 2023
52a9a8f
test
adam07018 Oct 28, 2023
dc71751
a
adam07018 Oct 28, 2023
a361ce7
Update node.js.yml
adam07018 Oct 28, 2023
914e0ba
Update node.js.yml
adam07018 Oct 28, 2023
89b16f2
t
adam07018 Oct 28, 2023
251e374
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 28, 2023
18da6fa
a
adam07018 Oct 28, 2023
8150a45
q
adam07018 Oct 28, 2023
63afe66
a
adam07018 Oct 28, 2023
f3ef1aa
a
adam07018 Oct 28, 2023
7a8f76b
add dependecny
adam07018 Oct 28, 2023
de36e37
q
adam07018 Oct 28, 2023
fa6e25a
Update node.js.yml
adam07018 Oct 28, 2023
478c125
Update node.js.yml
adam07018 Oct 28, 2023
8886b97
Update node.js.yml
adam07018 Oct 28, 2023
d37e425
a
adam07018 Oct 28, 2023
60e1f0c
Update test case for get user : jwt token expire
adam07018 Oct 28, 2023
58271c5
Omit some testcases
adam07018 Oct 28, 2023
6762529
a
adam07018 Oct 28, 2023
6b4e323
Change dockerfile to allow compose up and fix wss to ws
zzthian Oct 29, 2023
2e1cf10
Remove wss to ws
zzthian Oct 29, 2023
ac6c56b
Merge categories PR
zzthian Oct 29, 2023
7e746c8
Add communication to compose.yml
zzthian Oct 29, 2023
36dbd16
Fix changed route
zzthian Oct 29, 2023
bfab5b5
Merge pull request #55 from zzthian/master
adam07018 Oct 29, 2023
d7ee408
Merge latest
zzthian Oct 29, 2023
67dbe35
Add question service to CICD
zzthian Oct 30, 2023
73dad6d
Fix aws.yml file variable names for task id
zzthian Oct 30, 2023
4123594
Add question service task definition
zzthian Oct 30, 2023
81dd844
Fix container name
zzthian Oct 30, 2023
6debd78
Add platform to build
zzthian Oct 30, 2023
6b079aa
Change platform in dockerfile
zzthian Oct 30, 2023
9b7b527
Change platform
zzthian Oct 30, 2023
000a8be
Change platform
zzthian Oct 30, 2023
24e947f
Change platform
zzthian Oct 30, 2023
7191ed4
Change runner
zzthian Oct 30, 2023
2b91f97
Change to x86
zzthian Oct 30, 2023
25e7fdd
Merge branch 'master' into master
adam07018 Oct 30, 2023
2bc5fcf
Merge pull request #54 from ChangGittyHub/master
adam07018 Oct 30, 2023
19dcb30
Revert "Room.js retrieves questions from the question database"
adam07018 Oct 30, 2023
4fa3e8b
Merge pull request #56 from CS3219-AY2324S1/revert-54-master
adam07018 Oct 30, 2023
a24debe
New test cases for updateUser
adam07018 Oct 30, 2023
28fa354
Test out test coverage
adam07018 Oct 30, 2023
ccefc0d
Update node.js.yml
adam07018 Oct 30, 2023
af3a981
Update node.js.yml
adam07018 Oct 30, 2023
e13a3fe
New test for setUserAdmin and checkUserAdmin
adam07018 Oct 30, 2023
63612b5
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 30, 2023
48262b0
Test
adam07018 Oct 30, 2023
064bfc3
Update task definitions
zzthian Oct 30, 2023
281c38c
Trying with this env variable
zzthian Oct 30, 2023
371b39c
Hardcoding the string in
zzthian Oct 30, 2023
55f1dc0
q
adam07018 Oct 30, 2023
b5ce691
Merge branch 'master' into collabfrontend
adam07018 Oct 30, 2023
71e619a
Merge pull request #2 from adam07018/collabfrontend
adam07018 Oct 30, 2023
292e26e
Change name of workflow file
adam07018 Oct 30, 2023
2c92753
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 30, 2023
cb80982
Test ci fail
adam07018 Oct 30, 2023
0ca0c3a
try ci file
adam07018 Oct 30, 2023
bad31b0
q
adam07018 Oct 30, 2023
a23857b
Update user_profile_backend.js.yml
adam07018 Oct 30, 2023
a0d787c
Update user_profile_backend.js.yml
adam07018 Oct 30, 2023
e203815
Update script command
adam07018 Oct 30, 2023
65b7092
Update user_profile_backend.js.yml
adam07018 Oct 30, 2023
a33a681
Update package.json
adam07018 Oct 30, 2023
20f52c7
Update user_profile_backend.js.yml
adam07018 Oct 30, 2023
d11c11f
Update package.json
adam07018 Oct 30, 2023
cb5e900
Create test cases addQuestion and deleteQuestion
adam07018 Oct 30, 2023
2677924
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 30, 2023
b4079a8
NavBar : Remove Admin Icon when user is not admin.
PeanutButters93 Oct 30, 2023
969ad63
Add QuestionHistoryPage placeholder
PeanutButters93 Oct 30, 2023
50b00f2
Add Frontend task definition and to CICD
zzthian Oct 30, 2023
17447d0
Room : Add SaveSolutionButton. Currently logs token and editor contents
PeanutButters93 Oct 30, 2023
2ba06cf
Rename LogEditorButton to CodeExecutionComponent for clarity
PeanutButters93 Oct 30, 2023
2641fd3
Add Matching service to CICD
zzthian Oct 30, 2023
a1d6530
Merge pull request #57 from adam07018/master
adam07018 Oct 31, 2023
1e8aa35
Test if it fails under 90% loc
adam07018 Oct 31, 2023
5946326
Merge branch 'CS3219-AY2324S1:master' into master
adam07018 Oct 31, 2023
4eba4aa
Update package.json
adam07018 Oct 31, 2023
b35e569
Revert "Update package.json"
adam07018 Oct 31, 2023
268dd4c
Last version
adam07018 Oct 31, 2023
bbb0d30
Merge pull request #59 from adam07018/master
adam07018 Oct 31, 2023
6030930
update workflow job name
adam07018 Oct 31, 2023
c019ac1
Update user_profile_backend.js.yml
adam07018 Oct 31, 2023
f62baee
Add test cases for getQuestion and updateQuestion
adam07018 Oct 31, 2023
0eb3258
Create CI workflow for question-backend
adam07018 Oct 31, 2023
9dcc219
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 31, 2023
a8c6621
Update question-backend.js.yml
adam07018 Oct 31, 2023
9f8b133
Update question-backend.js.yml
adam07018 Oct 31, 2023
171c4ba
Update CodeExecutionComponent to use data from local editor instead o…
PeanutButters93 Oct 30, 2023
bb65b46
Create test case for addCategory
adam07018 Oct 31, 2023
1f390cf
Merge branch 'master' of https://github.com/adam07018/ay2324s1-course…
adam07018 Oct 31, 2023
7fd6791
Finish test cases for controller in Question
adam07018 Oct 31, 2023
492c8dc
QuestionHistoryPage : Add a backend for future implementation
PeanutButters93 Oct 31, 2023
9be082f
Containerize Question History BE
PeanutButters93 Oct 31, 2023
5da6f37
Merge branch 'master' into QsnHistory
PeanutButters93 Nov 1, 2023
174b102
Add collab and comm to CICD
zzthian Nov 1, 2023
2b5be90
Fix frontend URLs
zzthian Nov 1, 2023
0194c67
Change back to ws
zzthian Nov 1, 2023
3a21410
Change to wss and split tasks
zzthian Nov 1, 2023
82f5796
Change back to ws
zzthian Nov 1, 2023
6c64466
Change back to https, and add cors
zzthian Nov 1, 2023
58eb38b
Change Collab host url to be correct in diff files
zzthian Nov 1, 2023
7b0dab9
Remove some test output files
zzthian Nov 1, 2023
01d2c05
Merge branch 'master' into CICD
zzthian Nov 1, 2023
b995021
Change compose.yml file
zzthian Nov 1, 2023
15b582a
Change CICD to track push to master
zzthian Nov 1, 2023
88dd694
Fix problem of buggy add question
zzthian Nov 1, 2023
f1baf85
Implement mutiple code language execution
adam07018 Nov 2, 2023
e65febc
Merge pull request #61 from PeanutButters93/QsnHistory
ChangGittyHub Nov 2, 2023
abba134
Remerge fetch questions from database function
ChangGittyHub Nov 2, 2023
5c9c7d7
Collab : Add Barebones RabbitMQ queueing api call
PeanutButters93 Nov 2, 2023
5dbfe63
question-history-backend : Add RabbitMQ consumer for reciving databas…
PeanutButters93 Nov 2, 2023
efc216e
Create model and getQuestionHistory api
ChangGittyHub Nov 2, 2023
b62a3aa
Update docker-compose
PeanutButters93 Nov 2, 2023
aaa190b
History BE : Update to log userid instead of token
PeanutButters93 Nov 2, 2023
2ae11e1
Add deleting user functionality
zzthian Nov 3, 2023
c974131
Rectify error handling in login page
kohkaixun Nov 3, 2023
dd89936
Rectify error handling in signup page
kohkaixun Nov 3, 2023
fc116dc
Pulling Questions on the fly
ChangGittyHub Nov 4, 2023
39efb3e
Merge branch 'questions_branch'
ChangGittyHub Nov 4, 2023
68ce4cc
Merge pull request #65 from ChangGittyHub/master
ChangGittyHub Nov 4, 2023
b5f679f
Merge branch 'master' of https://github.com/ChangGittyHub/ay2324s1-co…
ChangGittyHub Nov 4, 2023
395d2c7
Rename Log Component to CodeExecutionComponent
ChangGittyHub Nov 4, 2023
eb03b56
Add alt port
zzthian Nov 4, 2023
7626296
Update testcase
zzthian Nov 4, 2023
3d77e0d
Merge pull request #60 from adam07018/master
zzthian Nov 4, 2023
e5b6878
Merge branch 'master' into login-signup
kohkaixun Nov 4, 2023
b4b61b4
Merge pull request #64 from kohkaixun/login-signup
zzthian Nov 4, 2023
6d4d3c0
Install Axios
ChangGittyHub Nov 4, 2023
1986cb2
Fix major bugs due to revert issues
ChangGittyHub Nov 4, 2023
3840f2e
Rename Button
ChangGittyHub Nov 4, 2023
ae19017
Merge branch 'master' into questions_branch_test
ChangGittyHub Nov 4, 2023
b89049c
Fix Bug
ChangGittyHub Nov 4, 2023
eddfca9
Merge branch 'master' of https://github.com/ChangGittyHub/ay2324s1-co…
ChangGittyHub Nov 4, 2023
7ac04e2
Merge branch 'master' into questions_branch_test
ChangGittyHub Nov 4, 2023
0016269
Merge pull request #66 from ChangGittyHub/master
ChangGittyHub Nov 4, 2023
41946f6
Merge branch 'master' into QsnHistory
PeanutButters93 Nov 4, 2023
899cacc
Merge branch 'Question-History' into QsnHistory
PeanutButters93 Nov 4, 2023
cd8b8eb
Merge branch 'master' into Question-History
ChangGittyHub Nov 4, 2023
305e822
Remove duplicate get Question in questionRouter
ChangGittyHub Nov 4, 2023
149ca31
Collab BE : Save button now sends token (includes user_id), question,…
PeanutButters93 Nov 4, 2023
d3380ae
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-a…
zzthian Nov 4, 2023
7040ccf
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-a…
zzthian Nov 4, 2023
3bf1f22
Make ready for production
zzthian Nov 4, 2023
8c323e0
Merge pull request #62 from zzthian/master
ChangGittyHub Nov 4, 2023
a9e2986
Fix remaining DockerFiles. Forgot to include in previous commit
zzthian Nov 4, 2023
6eaec00
Revamp Question History page
ChangGittyHub Nov 4, 2023
0a21a1e
Merge pull request #67 from zzthian/master
PeanutButters93 Nov 5, 2023
8a52623
Merge branch 'master' into QsnHistory
PeanutButters93 Nov 5, 2023
4389704
Merge branch 'Darren'
zzthian Nov 6, 2023
6eed70a
Merge pull request #68 from zzthian/master
ChangGittyHub Nov 6, 2023
050377a
Hotfix
zzthian Nov 6, 2023
8ac58ea
Hotfix 2
zzthian Nov 6, 2023
527beb7
Merge pull request #69 from zzthian/master
zzthian Nov 6, 2023
8fef4f5
deleteUser : Temporarily disable delete user feature
PeanutButters93 Nov 6, 2023
a60af04
Question History BE : Update add question to validate token on BE
PeanutButters93 Nov 6, 2023
dab1c8c
Fix History Backend crashing by having it restart when it crashes
PeanutButters93 Nov 6, 2023
dacaab1
SaveSolutionButton now saves and exits
PeanutButters93 Nov 6, 2023
bfcf035
Question History BE : Refactor code in index.js
PeanutButters93 Nov 6, 2023
a720204
Room : Change UI
PeanutButters93 Nov 6, 2023
8eec06d
Merge branch 'UI-Changes-1' into QsnHistory
PeanutButters93 Nov 6, 2023
1349cc9
Added QuestionHistory in progress
ChangGittyHub Nov 7, 2023
adc6e1c
Try
ChangGittyHub Nov 7, 2023
aa324b3
Testing
ChangGittyHub Nov 7, 2023
5eefa38
Connected frontend and backend
ChangGittyHub Nov 7, 2023
1e31137
Merge branch 'another-branch' of https://github.com/ChangGittyHub/ay2…
PeanutButters93 Nov 7, 2023
4307309
Change Timestamp to Date (ISO standard)
PeanutButters93 Nov 7, 2023
6ecf0f3
Revert "Change Timestamp to Date (ISO standard)"
PeanutButters93 Nov 7, 2023
70a04ba
Revamp Question history page
ChangGittyHub Nov 7, 2023
b84f83c
Reverse the order from latest to oldest
ChangGittyHub Nov 7, 2023
dc86dfd
History BE :: Link message queues to database
PeanutButters93 Nov 7, 2023
f6ac04a
Update the modal wiht bug fixes
ChangGittyHub Nov 7, 2023
22641d5
Merge branch 'Question-History' of https://github.com/ChangGittyHub/a…
PeanutButters93 Nov 7, 2023
03b6220
Merge branch 'master' into QsnHistory
PeanutButters93 Nov 7, 2023
96866b8
Add rabbitmq to task-definition.json
PeanutButters93 Nov 8, 2023
92ee77a
Move deleteUserEventCreation from User-Profile BE to History-BE, and …
PeanutButters93 Nov 8, 2023
ed191fa
Move saving question function from collab BE to history BE
PeanutButters93 Nov 8, 2023
9881380
Condense createDeleteUserEvent and the consumer into one function
PeanutButters93 Nov 8, 2023
7306047
Remove RabbitMQ from question-history-backend
PeanutButters93 Nov 8, 2023
58ec0f4
Question History BE : Add files for testing and prod
PeanutButters93 Nov 8, 2023
ad98e75
Revert last commit
PeanutButters93 Nov 8, 2023
d4fbd75
Merge branch 'QsnHistorya' into QsnHistory
PeanutButters93 Nov 8, 2023
8a8058a
Merge pull request #70 from PeanutButters93/QsnHistory
zzthian Nov 8, 2023
3e01733
Add workflow to deploy Question history
zzthian Nov 8, 2023
2650913
Rename files and imports
zzthian Nov 8, 2023
d337465
Merge pull request #71 from zzthian/master
zzthian Nov 8, 2023
eafdcda
add dot com
zzthian Nov 8, 2023
337c910
Merge pull request #72 from zzthian/master
kohkaixun Nov 8, 2023
84cb62c
Rectify admin view
kohkaixun Nov 9, 2023
5b1b2e3
Remove middleware for getCategories
kohkaixun Nov 10, 2023
db405cb
Merge pull request #73 from kohkaixun/master
zzthian Nov 10, 2023
dcbe750
Fix bug on sockets crashing on spam new questions
zzthian Nov 10, 2023
574a6c9
Allow for toggling of video
zzthian Nov 11, 2023
936bf85
Exclude middleware from getting Categories
zzthian Nov 14, 2023
8eb0108
Rename button for better usability
zzthian Nov 14, 2023
277c7c6
Merge pull request #74 from zzthian/master
kohkaixun Nov 14, 2023
d25d363
Remove commented out css files
ChangGittyHub Nov 14, 2023
ba5d6d6
Reposition video call to be in a more convenient location
zzthian Nov 14, 2023
ca99d40
Merge pull request #75 from ChangGittyHub/master
zzthian Nov 15, 2023
b8cf27c
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-a…
zzthian Nov 15, 2023
179dfa9
Merge pull request #76 from zzthian/master
adam07018 Nov 15, 2023
443851c
Final for report
zzthian Nov 15, 2023
8073bf4
Create README.md
adam07018 Nov 15, 2023
73c7b18
Update README.md
adam07018 Nov 15, 2023
bbfeb11
Merge pull request #77 from CS3219-AY2324S1/adam07018-patch-1
adam07018 Nov 15, 2023
9d38d99
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-a…
zzthian Nov 15, 2023
def6dd8
Add Report
zzthian Nov 15, 2023
807dfb2
Merge pull request #78 from zzthian/master
PeanutButters93 Nov 15, 2023
a908afa
add deadline
github-classroom[bot] Nov 18, 2023
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
Binary file added .DS_Store
Binary file not shown.
Empty file removed .github/.keep
Empty file.
76 changes: 76 additions & 0 deletions .github/workflows/collab-be-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

name: Deploy Collab BE to Amazon ECS

on:
push:
branches: [ "master" ]

env:
AWS_REGION: ap-southeast-1 # set this to your preferred AWS region, e.g. us-west-1

ECR_COLLABORATION_REPOSITORY: peerprep-collab-backend

ECS_COLLABORATION_SERVICE: Peerprep-Collab-Backend

ECS_CLUSTER: PeerPrepDev # set this to your Amazon ECS cluster name

ECS_COLLABORATION_TASK_DEFINITION: ./backend/collab-backend/task-definition.json


COLLABORATION_CONTAINER_NAME: Peerprep-Collab-Backend


permissions:
contents: read

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
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: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
#repeat everything below this for each service

- name: Collaboration service - Build, tag, and push image to Amazon ECR
id: build-collaboration-service-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.

docker build -t $ECR_REGISTRY/$ECR_COLLABORATION_REPOSITORY:$IMAGE_TAG -f ./backend/collab-backend/Dockerfile.prod ./backend/collab-backend
docker push $ECR_REGISTRY/$ECR_COLLABORATION_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_COLLABORATION_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: collaboration-service-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_COLLABORATION_TASK_DEFINITION }}
container-name: ${{ env.COLLABORATION_CONTAINER_NAME }}
image: ${{ steps.build-collaboration-service-image.outputs.image }}

- name: Collaboration service - Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.collaboration-service-task-def.outputs.task-definition }}
service: ${{ env.ECS_COLLABORATION_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
76 changes: 76 additions & 0 deletions .github/workflows/comm-be-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

name: Deploy Comm BE to Amazon ECS

on:
push:
branches: [ "master" ]

env:
AWS_REGION: ap-southeast-1 # set this to your preferred AWS region, e.g. us-west-1


ECR_COMMUNICATION_REPOSITORY: peerprep-communication-backend

ECS_COMMUNICATION_SERVICE: Peerprep-Comm-Backend


ECS_CLUSTER: PeerPrepDev # set this to your Amazon ECS cluster name

ECS_COMMUNICATION_TASK_DEFINITION: ./backend/communication-backend/task-definition.json

COMMUNICATION_CONTAINER_NAME: Peerprep-Comm-Backend


permissions:
contents: read

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
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: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Communication service - Build, tag, and push image to Amazon ECR
id: build-communication-service-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.

docker build -t $ECR_REGISTRY/$ECR_COMMUNICATION_REPOSITORY:$IMAGE_TAG -f ./backend/communication-backend/Dockerfile.prod ./backend/communication-backend
docker push $ECR_REGISTRY/$ECR_COMMUNICATION_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_COMMUNICATION_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: communication-service-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_COMMUNICATION_TASK_DEFINITION }}
container-name: ${{ env.COMMUNICATION_CONTAINER_NAME }}
image: ${{ steps.build-communication-service-image.outputs.image }}

- name: Communication service - Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.communication-service-task-def.outputs.task-definition }}
service: ${{ env.ECS_COMMUNICATION_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
103 changes: 103 additions & 0 deletions .github/workflows/fe-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# This workflow will build and push a new container image to Amazon ECR,
# and then will deploy a new task definition to Amazon ECS, when there is a push to the "master" branch.
#
# To use this workflow, you will need to complete the following set-up steps:
#
# 1. Create an ECR repository to store your images.
# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`.
# Replace the value of the `ECR_REPOSITORY` environment variable in the workflow below with your repository's name.
# Replace the value of the `AWS_REGION` environment variable in the workflow below with your repository's region.
#
# 2. Create an ECS task definition, an ECS cluster, and an ECS service.
# For example, follow the Getting Started guide on the ECS console:
# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun
# Replace the value of the `ECS_SERVICE` environment variable in the workflow below with the name you set for the Amazon ECS service.
# Replace the value of the `ECS_CLUSTER` environment variable in the workflow below with the name you set for the cluster.
#
# 3. Store your ECS task definition as a JSON file in your repository.
# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`.
# Replace the value of the `ECS_TASK_DEFINITION` environment variable in the workflow below with the path to the JSON file.
# Replace the value of the `CONTAINER_NAME` environment variable in the workflow below with the name of the container
# in the `containerDefinitions` section of the task definition.
#
# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
# See the documentation for each action used below for the recommended IAM policies for this IAM user,
# and best practices on handling the access key credentials.

name: Deploy to Amazon ECS

on:
push:
branches: [ "master" ]

env:
AWS_REGION: ap-southeast-1 # set this to your preferred AWS region, e.g. us-west-1


ECR_FRONTEND_REPOSITORY: peerprep-frontend

ECS_FRONTEND_SERVICE: PeerPrep-FE


ECS_CLUSTER: PeerPrepDev # set this to your Amazon ECS cluster name

ECS_FRONTEND_TASK_DEFINITION: ./frontend/task-definition.json

FRONTEND_CONTAINER_NAME: peerprep-frontend

permissions:
contents: read

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
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: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
#repeat everything below this for each service

- name: Frontend service - Build, tag, and push image to Amazon ECR
id: build-frontend-service-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.

docker build -t $ECR_REGISTRY/$ECR_FRONTEND_REPOSITORY:$IMAGE_TAG -f ./frontend/Dockerfile.prod ./frontend
docker push $ECR_REGISTRY/$ECR_FRONTEND_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_FRONTEND_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: frontend-service-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_FRONTEND_TASK_DEFINITION }}
container-name: ${{ env.FRONTEND_CONTAINER_NAME }}
image: ${{ steps.build-frontend-service-image.outputs.image }}

- name: Frontend service - Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.frontend-service-task-def.outputs.task-definition }}
service: ${{ env.ECS_FRONTEND_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true


79 changes: 79 additions & 0 deletions .github/workflows/history-be-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

name: Deploy History BE to Amazon ECS

on:
push:
branches: [ "master" ]

env:
AWS_REGION: ap-southeast-1 # set this to your preferred AWS region, e.g. us-west-1


ECR_HISTORY_REPOSITORY: peerprep-history-backend


ECS_HISTORY_SERVICE: Peerprep-History-Backend


ECS_CLUSTER: PeerPrepDev # set this to your Amazon ECS cluster name


ECS_HISTORY_TASK_DEFINITION: ./backend/question-history-backend/task-definition.json


HISTORY_CONTAINER_NAME: Peerprep-History-Backend

permissions:
contents: read

jobs:
deploy:
name: Deploy History BE
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
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: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1


- name: History service - Build, tag, and push image to Amazon ECR
id: build-history-service-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.

docker build -t $ECR_REGISTRY/$ECR_HISTORY_REPOSITORY:$IMAGE_TAG -f ./backend/question-history-backend/Dockerfile.prod ./backend/question-history-backend
docker push $ECR_REGISTRY/$ECR_HISTORY_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_HISTORY_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: history-service-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_HISTORY_TASK_DEFINITION }}
container-name: ${{ env.HISTORY_CONTAINER_NAME }}
image: ${{ steps.build-history-service-image.outputs.image }}

- name: Matching service - Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.history-service-task-def.outputs.task-definition }}
service: ${{ env.ECS_HISTORY_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
Loading
Loading