Skip to content

Commit c5a13e3

Browse files
committed
fix: ECR login step 변경
1 parent 4e3fa6c commit c5a13e3

File tree

2 files changed

+29
-44
lines changed

2 files changed

+29
-44
lines changed

.github/workflows/deploy-fluentbit.yml

+29-7
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,33 @@ env:
1919
TAG: latest
2020

2121
jobs:
22+
login-ecr:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Configure AWS credentials
26+
uses: aws-actions/configure-aws-credentials@v2
27+
with:
28+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
29+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
30+
aws-region: ap-northeast-2
31+
32+
- name: Login to Amazon ECR
33+
id: login-ecr
34+
uses: aws-actions/amazon-ecr-login@v1
35+
with:
36+
mask-password: 'true'
37+
2238
deploy-dev:
2339
runs-on: ubuntu-latest
2440
steps:
2541
- name: Check out code
26-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
2743

28-
- name: Push image to Amazon ECR
29-
uses: ./.github/workflows/push-image.yml
30-
with:
31-
uri: ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }}
32-
working-directory: ./fluentbit
44+
- name: Build and push image to Amazon ECR
45+
run: |
46+
docker build -t ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }} .
47+
docker push ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }}
48+
working-directory: ./fluentbit
3349

3450
- name: Pull image from Amazon ECR and restart container in EC2
3551
uses: appleboy/ssh-action@master
@@ -47,7 +63,13 @@ jobs:
4763
runs-on: ubuntu-latest
4864
steps:
4965
- name: Check out code
50-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
67+
68+
- name: Build and push image to Amazon ECR
69+
run: |
70+
docker build -t ${{ env.ENDPOINT }}/${{ env.PROD_REPO }}:${{ env.TAG }} .
71+
docker push ${{ env.ENDPOINT }}/${{ env.PROD_REPO }}:${{ env.TAG }}
72+
working-directory: ./fluentbit
5173

5274
- name: Push image to Amazon ECR
5375
uses: ./.github/workflows/push-image.yml

.github/workflows/push-image.yml

-37
This file was deleted.

0 commit comments

Comments
 (0)