diff --git a/.github/workflows/push-image.yml b/.github/workflows/push-image.yml index d78a4e4..c0cbb4c 100644 --- a/.github/workflows/push-image.yml +++ b/.github/workflows/push-image.yml @@ -59,36 +59,16 @@ jobs: if: inputs.build_image uses: actions/checkout@v4 - - name: Set up Docker Buildx for build-push-action + - name: "Build image ${{ inputs.image_name }} with tag '${{ inputs.image_tag }}'" if: inputs.build_image - uses: docker/setup-buildx-action@v3 - # with: - # version: latest - # driver-opts: image=moby/buildkit:latest - - - name: "Login to Docker Hub for build-push-action" - if: inputs.build_image - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: "Build Docker image" - id: build - if: inputs.build_image - uses: docker/build-push-action@v5 - # env: - # ECR_PATH: ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPO }} - with: - context: ${{ inputs.dockerfile_folder }} - tags: "${{ inputs.image_name }}:${{ inputs.image_tag }}" - load: true - cache-from: type=gha - cache-to: type=gha,mode=max - # cache-from: type=registry,ref=${{ env.ECR_PATH }}:dockercache - # cache-to: type=registry,ref=${{ env.ECR_PATH }}:dockercache,mode=max,image-manifest=true + shell: bash + env: + ECR_PATH: ${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPO }} + run: | + cd ${{ inputs.dockerfile_folder }} + docker build -t "${{ inputs.image_name }}:${{ inputs.image_tag }}" . - - name: "Publish image ${{ inputs.image_name }} with tag '${{ inputs.image_tag }}'" + - name: "Publish image to AWS ECR'" if: inputs.build_image shell: bash env: