Skip to content

Commit

Permalink
fix: githubaction error
Browse files Browse the repository at this point in the history
  • Loading branch information
GIVEN53 committed Sep 29, 2023
1 parent c2cee20 commit 1403e3c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/deploy-fluentbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion fluentbit/fluent-bit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
Name kinesis_streams
Match server.log
region ap-northeast-2
stream kn-server-log-${env}
stream kn-server-log-${env}

0 comments on commit 1403e3c

Please sign in to comment.