diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 951ed867..fbbc738d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,13 +39,18 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + - name: Log in to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 with: - region: ${{ secrets.AWS_REGION }} - access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + registry-type: public - name: Build and Push Image uses: docker/build-push-action@v5 @@ -57,8 +62,8 @@ jobs: ${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }} ghcr.io/${{ github.repository_owner }}/nas-tools:latest ghcr.io/${{ github.repository_owner }}/nas-tools:${{ env.app_version }} - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.AWS_REGISTRY_ALIAS }}/nas-tools:latest - ${{ steps.login-ecr.outputs.registry }}/${{ secrets.AWS_REGISTRY_ALIAS }}/nas-tools:${{ env.app_version }} + ${{ steps.login-ecr-public.outputs.registry }}/${{ secrets.AWS_REGISTRY_ALIAS }}/nas-tools:latest + ${{ steps.login-ecr-public.outputs.registry }}/${{ secrets.AWS_REGISTRY_ALIAS }}/nas-tools:${{ env.app_version }} - name: Logout from Amazon ECR - run: docker logout ${{ steps.login-ecr.outputs.registry }} \ No newline at end of file + run: docker logout ${{ steps.login-ecr-public.outputs.registry }} \ No newline at end of file