Applying matrix build to included CI template

Hi there,

I have a GitLab CI pipeline that is largely based upon an included template:

include:
  - project: 'docker/builder'
    file: '/templates/.gitlab-ci.yml'

variables:
  DOCKER_SQUASH: '1'
  MULTIARCH: '1'
  UBUNTU_VERSION: '20.04'

I’d like to combine this with a matrix build where I run the build for multiple UBUNTU_VERSIONs. Is there a way to do so without duplicating the template?

Thanks!