

You should look into “Configuration as code”, where you use automation via various methods and store the code in a git repo. The other commenter in the thread is a good example of this methodology, using Terraform and Ansible, but there are many ways to do this.
There a source port of at least portal 1.
https://github.com/AruMoon/source-engine
Here’s the active fork of the original project. Going through the issues of the original project, it seems to have support for building for 64 bit platforms.
No portal 2 support though. Although mentioned in the issues of nileusr’s repo is this: https://github.com/EpicSentry/P2ASW , which is interesting