Skip to content

Commit

Permalink
feat : Update be-autodeploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTH916 authored Jan 28, 2024
1 parent 8384190 commit 6e120ee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/be-autodeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ jobs:
steps:
- name: Set up SSH
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ssh_key.pem
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.DEV_HOST }} >> ~/.ssh/known_hosts
- name: connect ssh to Nginx server
- name: SSH Connection to EC2 Instance
run: |
ssh -i ssh_key.pem ${{ secrets.DEV_USERNAME }}@${{ secrets.DEV_HOST }} <<- 'EOSSH'
ssh -o "StrictHostKeyChecking=no" ${{ secrets.DEV_USERNAME }}@${{ secrets.DEV_HOST }} 'echo "Connected to EC2 Instance"'
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob
docker stop my_was_container
docker rm my_was_container
docker run -d -p 8000:8000 -e API_KEY=${{ secrets.DEV_APIKEY }} --name my_was_container --network mynetwork ${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob
docker image prune -f
EOSSH

0 comments on commit 6e120ee

Please sign in to comment.