Skip to content

Commit da09f1f

Browse files
committed
#45 fix: AWS 자격 증명 구성 설정
1 parent 53a561f commit da09f1f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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
@@ -35,7 +41,7 @@ jobs:
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 }}

0 commit comments

Comments
 (0)