Skip to content

Commit 72e243a

Browse files
committed
fix: github actions 명령어 수정 (SSM으로 직접 명령 날리게)
1 parent e003365 commit 72e243a

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Send command to EC2
14-
uses: aws-actions/aws-ssm-send-command@v1
15-
with:
16-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
17-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18-
aws-region: ${{ secrets.AWS_REGION }}
19-
instance-ids: ${{ secrets.EC2_INSTANCE_ID }}
20-
document-name: AWS-RunShellScript
21-
comment: "Deploying latest image"
22-
parameters: commands=["cd ~/your-folder && git pull && docker compose up -d"]
13+
- name: Install AWS CLI
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y awscli
17+
18+
- name: Deploy via SSM
19+
env:
20+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
21+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
22+
AWS_REGION: ${{ secrets.AWS_REGION }}
23+
EC2_INSTANCE_ID: ${{ secrets.EC2_INSTANCE_ID }}
24+
run: |
25+
aws ssm send-command \
26+
--document-name "AWS-RunShellScript" \
27+
--instance-ids "$EC2_INSTANCE_ID" \
28+
--region "$AWS_REGION" \
29+
--comment "Deploying via SSM" \
30+
--parameters commands=["cd ~/your-folder && git pull && docker compose up -d"] \
31+
--output text

0 commit comments

Comments
 (0)