diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 866e726..a391996 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -62,13 +62,15 @@ jobs: - name: Upload deploy script run: | BASE64_SCRIPT=$(base64 -w0 deployment/scripts/deploy_ec2.sh) + aws ssm send-command \ --instance-ids ${{ secrets.EC2_INSTANCE_ID }} \ --document-name "AWS-RunShellScript" \ - --comment "Upload deploy script" \ - --parameters commands="bash -c 'echo $BASE64_SCRIPT | base64 -d > /home/ec2-user/deploy_ec2.sh && chmod +x /home/ec2-user/deploy_ec2.sh'" \ + --comment "Upload deploy_ec2.sh" \ + --parameters "commands=echo ${BASE64_SCRIPT} | base64 -d > /home/ec2-user/deploy_ec2.sh,chmod +x /home/ec2-user/deploy_ec2.sh" \ --output text + - name: Deploy via SSM run: | aws ssm send-command \