Changed site publish destination back to root
Extracted the write to repo functionality into a method.