-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from HUNG-rushb/develop
Develop
- Loading branch information
Showing
161 changed files
with
21,733 additions
and
21,077 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": "> 0.25%, not dead" | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-transform-runtime", | ||
{ | ||
"regenerator": true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
DATABASE_URL="mongodb+srv://Hung:[email protected]/Social_Image" | ||
DATABASE_URL="mongodb+srv://Hung:[email protected]/Social_Image" | ||
USER_SIMILAR_WEIGHT={"following":"0.5","interest":"0.3","skill":"0.2"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DATABASE_URL= | ||
IS_LOGGING=1 | ||
# Link Public = https://roxqm2ljb8.execute-api.ap-southeast-1.amazonaws.com/ | ||
# For tool generatePosts | ||
AWS_ACCESS_KEY= | ||
AWS_SECRET_ACCESS= | ||
AWS_BUCKET_NAME= | ||
APP_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"ignorePatterns": [".eslintrc.js", "____Legacy/**","dist/**", "node_modules/**"], | ||
"parserOptions": { | ||
"project": "jsconfig.json", | ||
"sourceType": "module", | ||
"ecmaVersion": "latest" | ||
}, | ||
"rules": { | ||
"no-unused-vars": "warn", | ||
"prettier/prettier": [ | ||
"warn", | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"endOfLine": "lf", | ||
"singleQuote": true, | ||
"overrides": [ | ||
{ | ||
"files": "*.json", | ||
"options": { | ||
"tabWidth": 6 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Deploy to AWS Lambda | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy | ||
- develop | ||
pull_request: | ||
branches: | ||
- deploy | ||
- develop | ||
workflow_dispatch: | ||
branches: | ||
- deploy | ||
- develop | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_IAM_ROLE_ARN: ${{ secrets.AWS_IAM_ROLE_ARN }} | ||
OWNER_LAYER_ACCOUNT_ID: ${{ secrets.OWNER_LAYER_ACCOUNT_ID }} | ||
|
||
steps: | ||
- name: Check if it's a merge commit | ||
run: | | ||
if [ -n "$(git log -1 --merges --pretty=%B)" ]; then | ||
echo "This is a merge commit. Skipping the workflow." | ||
exit 78 | ||
fi | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
|
||
- 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: Update Code | ||
run: | | ||
npm install | ||
npm run prisma_gen | ||
npm run build | ||
cp src/prisma/ERD.svg dist/prisma/ERD.svg | ||
cp src/prisma/schema.prisma dist/prisma/schema.prisma | ||
cp -r src/prisma_modules dist/prisma_modules | ||
zip -r code.zip dist | ||
aws lambda update-function-code --function-name images-social-backend-service --zip-file fileb://code.zip | ||
- name: Update Node Modules | ||
run: | | ||
mkdir nodejs | ||
cp package.json nodejs/package.json | ||
cd nodejs | ||
npm install --omit=dev | ||
rm package.json package-lock.json | ||
cd .. | ||
zip -r ${GITHUB_WORKSPACE}/package-layer.zip nodejs | ||
aws s3 cp ${GITHUB_WORKSPACE}/package-layer.zip s3://images-social-backend-service-package-layer/package-layer.zip | ||
aws lambda publish-layer-version --layer-name arn:aws:lambda:ap-southeast-1:${OWNER_LAYER_ACCOUNT_ID}:layer:images-social-backend-service-package-layer --content S3Bucket=images-social-backend-service-package-layer,S3Key=package-layer.zip --compatible-runtimes nodejs16.x --compatible-architectures "arm64" "x86_64" | ||
maxLayerVersion=$(aws lambda list-layer-versions --layer-name arn:aws:lambda:ap-southeast-1:${OWNER_LAYER_ACCOUNT_ID}:layer:images-social-backend-service-package-layer --query 'max_by(LayerVersions, &Version).LayerVersionArn' | sed 's/"//g') | ||
aws lambda wait function-updated --function-name images-social-backend-service | ||
aws lambda update-function-configuration --function-name images-social-backend-service --layers $maxLayerVersion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
43 changes: 0 additions & 43 deletions
43
____Legacy/GraphQL-Course-Udemy-main/client/public/index.html
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
25 changes: 0 additions & 25 deletions
25
____Legacy/GraphQL-Course-Udemy-main/client/public/manifest.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
____Legacy/GraphQL-Course-Udemy-main/client/public/robots.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.