File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,14 +19,20 @@ jobs:
1919 id : ip
2020 uses : haythem/public-ip@v1.3
2121
22+ - name : Configure AWS Credentials
23+ uses : aws-actions/configure-aws-credentials@v2
24+ with :
25+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
26+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+ aws-region : ap-northeast-2
28+
2229 - name : Authorize GitHub IP
2330 run : |
2431 aws ec2 authorize-security-group-ingress \
2532 --group-id ${{ secrets.AWS_SECURITY_GROUP_ID }} \
2633 --protocol tcp \
2734 --port 22 \
2835 --cidr ${{ steps.ip.outputs.ipv4 }}/32
29- --region ap-northeast-2
3036
3137 - name : Deploy to EC2 with docker-compose
3238 uses : appleboy/ssh-action@v0.1.10
3541 username : ${{ secrets.EC2_USERNAME }}
3642 key : ${{ secrets.EC2_SSH_PRIVATE_KEY }}
3743 script : |
38- cd /home/ubuntu/app
44+ cd /home/${{ secrets.EC2_USERNAME }}/postdm
3945
4046 echo "Logging in to ECR..."
4147 aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY }}
You can’t perform that action at this time.
0 commit comments