gitlab-ci: Move before and after script to shared template