I’m trying to deploy a container into Lightsail, but it is failing, and I can’t figure out which mistake I made.
I am following this blog post
I could do everything up to step 5, including pushing the Docker image into AWS ECR.
The step that I’m struggling with is step 5 of the deployment process. The part where I am failing is
- name: Push the Docker Image to lightsail
env:
IMAGE_SHA_TAG: ${{ github.sha }}
IMAGE_URL: ${{vars.LIGHTSAIL_IMAGE}}:${{ github.sha }}
run: >
aws lightsail push-container-image
--service-name ${{ vars.SERVICE_NAME }}
--image $IMAGE_URL
--region us-east-2
--label git-push
- name: Save updated LIGHTSAIL_IMAGE_TAG
run: |
echo "LIGHTSAIL_DOCKER_IMAGE=$(aws lightsail get-container-images --service-name ${{ vars.SERVICE_NAME }} --region us-east-2 | jq -r .containerImages[0].image)" >> $GITHUB_ENV
I executed aws lightsail get-container-images --service-name ${{ vars.SERVICE_NAME }} --region us-east-2
and I get
{
"containerImages": []
}
I am not sure what should I put in var LIGHTSAIL_IMAGE
. Now I am referencing the ECR repository URI, but it is not working.