Skip to content

Commit

Permalink
server yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris-Siu committed Mar 2, 2024
1 parent aa75071 commit f8c3fd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/backend-ec2-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ jobs:
uses: actions/checkout@v3
- name: Add SSH key to agent
run: |
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-keygen -i /dev/stdin -f id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-keygen -i /dev/stdin -f id_rsa
chmod 600 id_rsa
ssh-add id_rsa
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: SSH into EC2 instance and deploy
run: |
ssh -i id_rsa ubuntu@$EC2_DNS "bash -c 'cd /server.js && git pull && npm install && pm2 start server.js'"
env:
EC2_DNS: ${{ secrets.EC2_DNS }}
ssh -i id_rsa ubuntu@${{ secrets.EC2_DNS }} "bash -c 'cd /server.js && git pull && npm install && pm2 start server.js'"
2 changes: 1 addition & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const db = new Pool({
// },
// ];
// GET "/"
//test3
//test4
app.get("/", (req, res) => {

db.query("SELECT * FROM videos", (error, result) => {
Expand Down

0 comments on commit f8c3fd9

Please sign in to comment.