<p>I have a Spring boot application and I deploy the application to Kubernetes using a single k8s.yml manifest file via Github actions. This k8s.yml manifest contains Secrets, Service, Ingress, Deployment configurations. I was able to deploy the application successfully as well. Now I plan to separate the Secrets, Service, Ingress, Deployment configurations into a separate file as secrets.yml, service.yml, ingress.yml and deployment.yml.</p>
<p>Previously I use the below command for deployment</p>
<pre><code>kubectl: 1.5.4
command: |
    sed -e 's/$SEC/${{ secrets.SEC }}/g' -e 's/$APP/${{ env.APP_NAME }}/g' -e 's/$ES/${{ env.ES }}/g' deployment.yml | kubectl apply -f -
</code></pre>
<p>Now after the separation I use the below commands</p>
<pre><code>kubectl: 1.5.4
command: |
  kubectl apply -f secrets.yml
  kubectl apply -f service.yml
  sed -e 's/$ES/${{ env.ES }}/g' ingress.yml | kubectl apply -f -
  sed -e 's/$SEC/${{ secrets.SEC }}/g' -e 's/$APP/${{ env.APP_NAME }}/g' deployment.yml | kubectl apply -f -
</code></pre>
<p>But some how the application is not deploying correctly, I would like to know if the command which I am using is correct or not</p>

Alex Man
<p>You can consider perform the <code>sed</code> first, then apply all files <code>kubectl apply -f .</code> instead of going one by one. Append <code>--recursive</code> if you have files in sub folder to apply, too.</p>
