From 1403e3c21727b62e3d41f450d16a416f8b55c678 Mon Sep 17 00:00:00 2001 From: NAM GIBEOM Date: Sat, 30 Sep 2023 05:51:29 +0900 Subject: [PATCH] fix: githubaction error --- .github/workflows/deploy-fluentbit.yml | 24 ++++++++++++++++++------ fluentbit/fluent-bit.conf | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-fluentbit.yml b/.github/workflows/deploy-fluentbit.yml index 2f9f4ac..2d39a96 100644 --- a/.github/workflows/deploy-fluentbit.yml +++ b/.github/workflows/deploy-fluentbit.yml @@ -13,14 +13,14 @@ env: IMAGE_TAG: latest jobs: - deploy-fluentbit: + login-to-aws-ecr: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v3 - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v2 with: # role-to-assume: "arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions" aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} @@ -29,14 +29,26 @@ jobs: - name: login to ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Build and push - id: build-image + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: 'false' + # outputs: + # registry: ${{ steps.login-ecr.outputs.registry }} + # docker_username: ${{ steps.login-ecr.outputs.username }} + # docker_password: ${{ steps.login-ecr.outputs.password }} + + build-and-push: + runs-on: ubuntu-latest + needs: login-to-aws-ecr + steps: + - name: Build and push image to Amazon ECR (dev) run: | docker build -t ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.DEV_ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} . docker push ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.DEV_ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + working-directory: './fluentbit' + - name: Build and push image to Amazon ECR (prod) + run: | docker build -t ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.PROD_ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} . docker push ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.PROD_ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} working-directory: './fluentbit' diff --git a/fluentbit/fluent-bit.conf b/fluentbit/fluent-bit.conf index d84801b..5a09756 100644 --- a/fluentbit/fluent-bit.conf +++ b/fluentbit/fluent-bit.conf @@ -36,4 +36,4 @@ Name kinesis_streams Match server.log region ap-northeast-2 - stream kn-server-log-${env} \ No newline at end of file + stream kn-server-log-${env}