Apply k8s deployment YAML from another repo?

I’m trying to create a pipeline that uses a .yaml deployment file from our repo where we have all those files stored. Something like this:

include:
  project: "ourgroup/deployment"
  file: "k8s/$CI_PROJECT_NAME/deployment.yaml"

deploy:
  script:
  - kubectl apply deployment.yaml

But I get the error

This GitLab CI configuration is invalid: jobs apiversion config should implement a script: or a trigger: keyword.

I presume this is because it thinks every imported file is supposed to be a pipeline script?

What’d be the best way to solve this?

Hi @carelyobot

include keyword is only for pipeline scripts, not for fetching files from other repositories. If you need that file you need to use the usual thinks like curl, wget or git clone.