I'm looking to setup a code repository for our liferay project and ideally basic configuration and maybe even a few pages should be part of the project. For settings specifically our site should only use OIDC as login and ideally that would already be setup if you clone the repository.
As far as I know these settings are saved in the database, so would the best way to get this done be a small script that executes the necessary SQL querys on the database?
There are multiple means to setup a portal using a code repository.
One approach is a Resource Importer
(importing-resources-with-a-theme) which can be used to auto-add articles, files, pages and similar objects.
Also you could use UpgradeProcess Components creating-an-upgrade-process-for-your-app to execute some code that setup your environment. Also, it is possible to export your system OSGi settings (if DXP) an put them to your Liferay workspace.
It also feasible to have some exported .lar archives that can be imported to setup a portal.
From my opinion, I would not encourage you to execute SQL files to directly modify the databases, as you might not know how those tables are related. Liferay takes care about persistency, and you should only use its exposed API methods.
The links are based on DXP but similar approaches exist for 6.X portals.