Skip to content

Commit

Permalink
fix: ECR login step 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
GIVEN53 committed Feb 7, 2024
1 parent 4e3fa6c commit c5a13e3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 44 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/deploy-fluentbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,33 @@ env:
TAG: latest

jobs:
login-ecr:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

deploy-dev:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Push image to Amazon ECR
uses: ./.github/workflows/push-image.yml
with:
uri: ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }}
working-directory: ./fluentbit
- name: Build and push image to Amazon ECR
run: |
docker build -t ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }} .
docker push ${{ env.ENDPOINT }}/${{ env.DEV_REPO }}:${{ env.TAG }}
working-directory: ./fluentbit

- name: Pull image from Amazon ECR and restart container in EC2
uses: appleboy/ssh-action@master
Expand All @@ -47,7 +63,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build and push image to Amazon ECR
run: |
docker build -t ${{ env.ENDPOINT }}/${{ env.PROD_REPO }}:${{ env.TAG }} .
docker push ${{ env.ENDPOINT }}/${{ env.PROD_REPO }}:${{ env.TAG }}
working-directory: ./fluentbit

- name: Push image to Amazon ECR
uses: ./.github/workflows/push-image.yml
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/push-image.yml

This file was deleted.

0 comments on commit c5a13e3

Please sign in to comment.