forked from CodeYourFuture/Full-Stack-Project-Assessment
-
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.
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 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 |
---|---|---|
|
@@ -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 [email protected] 'sudo docker pull shadi38/node-app:4.0' | ||
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker pull shadi38/node-app:4.0' | ||
- name: Stop running container | ||
run: | | ||
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' | ||
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' | ||
- name: Run new container | ||
run: | | ||
ssh -o StrictHostKeyChecking=no -i serveraws.pem [email protected] 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0' | ||
ssh -o StrictHostKeyChecking=no -i key.pem [email protected] 'sudo docker run -d --name node-app -p 3000:3000 shadi38/node-app:4.0' | ||
|