Hi, thanks for posting about this!
Publishing to the Gallery is possible only to teachers using Pro and shouldn’t be available to students.
If you’re looking to publish Assignments to the Gallery, you’ll have to make a copy of the assignment first, and get it under “My CoSpaces” in order to publish it to the Gallery.
Hope this helps!