Running common code for grouped jobs, how to do it?

There is a common set of code before the grouped jobs, how to write that in gitlab?
Common code—> here
sit_deploy 1/3:
when: manual
script:
-echo “Hello”
sit_deploy 1/1:
when: manual
script:
- echo “ruby1”
sit_deploy 1/2:
when: manual
script:
- echo “ruby2—”

Common code here for all the below jobs?

sit1_deploy 1/3:

before_script:
    # Setup SSH and agent, to connect to the deploy helper server.
    - echo "Rooooaaaarrrrr!!!!!!!!!!!"
when: manual
script:
   -echo "hello"

sit1_deploy 1/1:
when: manual
script:
- echo “ruby1”
sit1_deploy 1/2:
when: manual
script:
- echo “ruby2—”

Also if there any way to rename the grouped jobs ?