refactor: 타임아웃 시간 90초로 연장 #33
This file contains hidden or 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
| name: Deploy to EC2 via SSM | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install AWS CLI | |
| run: | | |
| curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
| unzip awscliv2.zip | |
| sudo ./aws/install --update | |
| - name: Deploy via SSM | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| EC2_INSTANCE_ID: ${{ secrets.EC2_INSTANCE_ID }} | |
| run: | | |
| aws ssm send-command \ | |
| --document-name "AWS-RunShellScript" \ | |
| --instance-ids "$EC2_INSTANCE_ID" \ | |
| --region "$AWS_REGION" \ | |
| --comment "Deploying via SSM" \ | |
| --parameters 'commands=["cd /home/ubuntu/CustomsChatBotAI", "git pull", "docker compose down && docker compose up -d --build", "if [ $(docker inspect -f \"{{.State.Running}}\" flask-ai-server) = true ]; then docker image prune -af; fi"]' \ | |
| --output text |