Swap only for rules syntax and collect common rules into a job
Updated the syntax in the gitlab CI file from only
to rules
as detailed in &2 (closed) and https://docs.gitlab.com/ci/yaml/#onlyrefs--exceptrefs
This MR also groups together common rules to avoid repetition
Edited by Beth Probert