I've used this exercise as a guidance. When using the image in the exercise (mcr.microsoft.com/mslearn/samples/contoso-website), then everything seems to "run" fine, but when changing out the image with ghcr.io/****, then I recieve an error for parsing the YAML file.
error: error parsing /tmp/deployment.yml: error converting YAML to JSON: yaml: line 27: mapping values are not allowed in this context
This causes the action to fail.
Version
[X] I am using the latest version
Runner
ubuntu-latest
Relevant log output
##[debug]Evaluating condition for step: 'Deploy to Azure'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy to Azure
##[debug]Loading inputs
##[debug]Evaluating: format('ghcr.io/{0}:{[1](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:1)}
##[debug]', env.image_name, needs.release-on-push.outputs.version)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'ghcr.io/{0}:{1}
##[debug]'
##[debug]..Evaluating Index:
##[debug]....Evaluating env:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'image_name'
##[debug]..=> '***/localizer'
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating needs:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'release-on-push'
##[debug]......=> null
##[debug]....=> null
##[debug]..=> null
##[debug]=> 'ghcr.io/***/localizer:
##[debug]'
##[debug]Result: 'ghcr.io/***/localizer:
##[debug]'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run Azure/k8s-deploy@v4
##[debug]Input manifest files: /tmp/deployment.yml,/tmp/service.yml,/tmp/ingress.yml
::group::Deploying manifests
Deploying manifests
##[debug]Kubectl run with command: /opt/hostedtoolcache/kubectl/1.[2](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:2)7.1/x6[4](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:4)/kubectl apply,-f,/tmp/deployment.yml,/tmp/service.yml,/tmp/ingress.yml,--namespace,default
/opt/hostedtoolcache/kubectl/1.27.1/x[6](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:6)4/kubectl apply -f /tmp/deployment.yml,/tmp/service.yml,/tmp/ingress.yml --namespace default
service/localizer unchanged
ingress.networking.k8s.io/localizer unchanged
error: error parsing /tmp/deployment.yml: error converting YAML to JSON: yaml: line 2[7](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:7): mapping values are not allowed in this context
##[debug]Kubectl apply failed:Error: The process '/opt/hostedtoolcache/kubectl/1.[27](https://github.com/AkusasDesign/localizer/actions/runs/4846714703/jobs/8642572870#step:5:27).1/x64/kubectl' failed with exit code 1
Error: Error: undefined
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy to Azure
What happened?
When running a job using Azure/k8s-deploy action:
and my deployment.yml file looks like this:
I've used this exercise as a guidance. When using the image in the exercise (mcr.microsoft.com/mslearn/samples/contoso-website), then everything seems to "run" fine, but when changing out the image with ghcr.io/****, then I recieve an error for parsing the YAML file.
error: error parsing /tmp/deployment.yml: error converting YAML to JSON: yaml: line 27: mapping values are not allowed in this context
This causes the action to fail.
Version
Runner
ubuntu-latest
Relevant log output