Skip to content

Commit

Permalink
Update sdk and action on master
Browse files Browse the repository at this point in the history
  • Loading branch information
huyleminh committed Sep 10, 2023
1 parent 55a6386 commit 8a98f13
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 17 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,31 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deployment:
name: Pull and up the docker image from docker registry
# deployment:
# name: Pull and up the docker image from docker registry
# runs-on: ubuntu-22.04
# needs: publish_to_registry
# steps:
# - name: Connect to EC2 server
# run: |
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > private_key && chmod 600 private_key
# ssh -o StrictHostKeyChecking=no -i private_key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo su - && cd ${{ secrets.SSH_WORKING_DIR }} && sudo docker pull sehcmusgroup1/socket-service:latest && sudo docker compose up -d socket-service && exit && exit"

# - name: Clean private key
# run: rm private_key

render-deployment:
name: Trigger render deploy hook
runs-on: ubuntu-22.04
needs: publish_to_registry
steps:
- name: Connect to EC2 server
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "sudo su - && cd ${{ secrets.SSH_WORKING_DIR }} && sudo docker pull sehcmusgroup1/socket-service:latest && sudo docker compose up -d socket-service && exit && exit"
- name: Clean private key
run: rm private_key
- name: Call depoy hook api
run: curl --request POST \
--url https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/deploys \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"clearCache": "clear"
}
'
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@huyleminh/nodejs-sdk": "^1.0.1",
"@huyleminh/nodejs-sdk": "^1.0.2",
"amqplib": "^0.10.3",
"axios": "^1.3.5",
"compression": "^1.7.4",
Expand Down
11 changes: 11 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
- type: web
name: presento-socket
numInstances: 1
runtime: image
image:
url: docker.io/sehcmusgroup1/socket-service:latest

region: singapore
plan: free
autoDeploy: false

0 comments on commit 8a98f13

Please sign in to comment.