Subject to federal law or regulation governing membership in the National Guard, no person shall be denied membership in the armed forces of the state, nor be discriminated against in the matter of promotion therein, on account of such person’s religion, national origin, color, race, sex, gender identity or expression or sexual orientation. No units of such organizations shall be formed, and no separate types of duties or separate accommodations shall be assigned, in such a manner as to result in the segregation of members thereof on account of religion, national origin, color, race, sex, gender identity or expression or sexual orientation, except that accommodations may be assigned consistent with any federal military regulation or service policy.