Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
miro-ring committed Dec 16, 2023
1 parent 318f35e commit 2f333fd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Deploy to EC2

run: |
echo "${{ secrets.EC2_SSH_PRIVATE_KEY }}" > private_key.pem
chmod 600 private_key.pem
ssh -i private_key.pem -o StrictHostKeyChecking=no ubuntu@${{ secrets.EC2_PUBLIC_IP }} "
aws ecr get-login-password --region ap-northeast-2 |
sudo docker login --username AWS --password-stdin ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} &&
if [ \$(sudo docker ps -q -f name=${{ env.IMAGE_NAME }}) ]; then
sudo docker stop ${{ env.IMAGE_NAME }} &&
sudo docker rm ${{ env.IMAGE_NAME }}
fi &&
sudo docker image pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }} &&
sudo docker container run --name ${{ env.IMAGE_NAME }} -d -p 3000:3000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}"

0 comments on commit 2f333fd

Please sign in to comment.