fix: actions ui 버전 변경 #3
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 | |
| - 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 ~/your-folder && git pull && docker compose up -d"] \ | |
| --output text |