From b99644a23fe2c7403f2ee33fc60c7508b97bf1fb Mon Sep 17 00:00:00 2001 From: shani Date: Sun, 19 May 2024 15:06:20 +0700 Subject: [PATCH 1/2] feat: add github action --- .github/workflows/{docker-image.yml.example => docker-image.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docker-image.yml.example => docker-image.yml} (100%) diff --git a/.github/workflows/docker-image.yml.example b/.github/workflows/docker-image.yml similarity index 100% rename from .github/workflows/docker-image.yml.example rename to .github/workflows/docker-image.yml From 4b9f7e408c57d0b3e335e6fce2dd7b384811aefb Mon Sep 17 00:00:00 2001 From: shani Date: Sun, 19 May 2024 15:10:48 +0700 Subject: [PATCH 2/2] feat: update workflow --- .github/workflows/docker-image.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c2eb58b..1aba24b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,13 +13,17 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Set up AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + - name: Log in to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - with: - region: ${{ secrets.AWS_REGION }} - access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY }} - name: Build, tag, and push Docker image env: