Solar photovoltaic (PV) produces electricity which can be directed to water electrolyzers to decompose H2O into H2 gas and O2 gas. The produced H2 gas can then be compressed and stored in tanks.
Some of the water electrolyzers are called high-pressure electrolyzers and accordingly they produce compressed H2 gas and, thus, eliminating the need for compressors.
I've a diagram that shows the integrated system for H2 production via solar PV. It is in one of my lecture notes on renewable energy sources (part of my course entitled Green Energy Systems which I developed and taught at Yale University).
You can download my lecture note that is relevant to your question from my profile under ResearchGate.net
Hope this helps answer your question and good luck.