Skip to content

Commit

Permalink
changed the key.pem
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadi38 committed Feb 13, 2024
1 parent 173cad3 commit 5cc14c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ jobs:
- name: Set permissions for private key

run: |
echo "${{ env.EC2_SSH_KEY }}" > key.pem
chmod 600 key.pem
echo "${{ env.EC2_SSH_KEY }}" > serveraws.pem
chmod 600 serveraws.pem
- name: Pull Docker image
run: |
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker pull shadi38/node-app:4.0'
ssh -o StrictHostKeyChecking=no -i serveraws.pem [email protected] 'sudo docker pull shadi38/node-app:4.0'
- name: Stop running container
run: |
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker stop node-app:4.0 || true'
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker rm node-app:4.0 || true'
ssh -o StrictHostKeyChecking=no -i serveraws.pem [email protected] 'sudo docker stop node-app:4.0 || true'
ssh -o StrictHostKeyChecking=no -i serveraws.pem [email protected] 'sudo docker rm node-app:4.0 || true'
- name: Run new container
run: |
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0'
ssh -o StrictHostKeyChecking=no -i serveraws.pem [email protected] 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0'
Expand Down

0 comments on commit 5cc14c2

Please sign in to comment.