From 0094db8abb4e7b9badeeaca89c3338b992980538 Mon Sep 17 00:00:00 2001 From: shadi fakhri <113238379+Shadi38@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:56:01 +0000 Subject: [PATCH] changed key.pem in server.yml --- .github/workflows/server.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 15c7b1c398..aea6971650 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -42,18 +42,18 @@ jobs: - name: Set permissions for private key run: | - echo "${{ env.AWS_PRIVATE_KEY }}" > serveraws.pem + echo "${{ env.AWS_PRIVATE_KEY }}" > key.pem chmod 600 serveraws.pem - name: Pull Docker image run: | - ssh -o StrictHostKeyChecking=no -i serveraws.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker pull shadi38/node-app:4.0' + ssh -o StrictHostKeyChecking=no -i key.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker pull shadi38/node-app:4.0' - name: Stop running container run: | - ssh -o StrictHostKeyChecking=no -i serveraws.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker stop node-app:4.0 || true' - ssh -o StrictHostKeyChecking=no -i serveraws.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker rm node-app:4.0 || true' + ssh -o StrictHostKeyChecking=no -i key.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker stop node-app:4.0 || true' + ssh -o StrictHostKeyChecking=no -i key.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker rm node-app:4.0 || true' - name: Run new container run: | - ssh -o StrictHostKeyChecking=no -i serveraws.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0' + ssh -o StrictHostKeyChecking=no -i key.pem ubuntu@ec2-13-49-244-227.eu-north-1.compute.amazonaws.com 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0'