Skip to content

Commit

Permalink
추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rrosiee committed Jul 9, 2024
1 parent ce3bc41 commit 84ee878
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@ jobs:
aws-region: ap-northeast-2

# Step 4: Deploy to EC2 instance
- name: Deploy to EC2
run: |
echo "${{ secrets.EC2_SSH_KEY }}" > key.pem
chmod 600 key.pem
ssh -o StrictHostKeyChecking=no -i key.pem -t ubuntu@${{ secrets.EC2_INSTANCE_IP }} << 'EOF'
docker pull public.ecr.aws/h7p2f6d8/ticats_ai:latest
docker-compose down
docker-compose up -d
EOF
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Deploy to server
uses: appleboy/ssh-action@master
id: deploy
with:
host: ${{ secrets.EC2_INSTANCE_IP }}
username: ubuntu
key: ${{ secrets.EC2_SSH_KEY }}
envs: |
DATABASE_URL=${{ secrets.DATABASE_URL }}
script: |
docker pull public.ecr.aws/h7p2f6d8/ticats_ai:latest
docker-compose down
docker-compose up -d
# Step 5: Log in to Amazon ECR (Elastic Container Registry)
- name: Login to Amazon ECR
Expand Down

0 comments on commit 84ee878

Please sign in to comment.