Skip to content

Commit

Permalink
feat : Update be-autodeploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
GeunH authored Jan 28, 2024
1 parent 5d738a4 commit 3c9ffff
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/be-autodeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,15 @@ jobs:
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: Set up SSH
run: |
ls -la ~
mkdir -v -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "SSH key write status: $?"
chmod 600 ~/.ssh/id_rsa
echo "chmod status: $?"
ls -la ~/.ssh
ssh-keyscan -H ${{ secrets.DEV_HOST }} >> ~/.ssh/known_hosts
echo "ssh-keyscan status: $?"
ls -la ~/.ssh
- name: SSH Connection to EC2 Instance
run: |
ssh -o "StrictHostKeyChecking=no" ${{ secrets.DEV_USERNAME }}@${{ secrets.DEV_HOST }} 'echo "Connected to EC2 Instance"'
- name: connect ssh to WAS server
uses: appleboy/ssh-action@master
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
script : |
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

0 comments on commit 3c9ffff

Please sign in to comment.