Procedural Generation of a Tilemap

Have a look on the Epic youtube channel they have an infinite runner tutorial that does exactly what you need