How to write a .gitlab-ci.yml file?

This is basically the same question as Configuring GitLab Runner with Node.js - #10 by hack3rcon, so the answer is the same to: neither gitlab nor a gitlab runner can run your website. That’s not what they do.

You need .gitlab-ci.yml to build docker containers for you (example in referenced thread) and then you need to run those containers somewhere so they can be accessed.

If you own the gitlab server I suppose you could serve it from there, but I personally wouldn’t want to dilute a server with two very different purposes and just get a third server to serve the website. Or, run the gitlab runner on the gitlab server so the gitlab runner server is free to do something else.