how do i deal with a “relationship” with my depressed girlfriend?
The important thing to remember when your loved one is suffering from a mental health issue is that you are not at fault for their symptoms. Without knowing specifically what she may be suffering from (you mentioned depression in your title), it is difficult to give many specifics on what you can do, but I will try to give you some suggestions on what might help.
It is important that you take care of yourself, first and foremost. While this may not seem like the thing to do, you won't be able to adequately support her if you don't. So if it is affecting your mental health, it may be worth looking into therapy for yourself to provide yourself some support. You also should do other things for coping and stress relief. This can be things that you enjoy as a hobby, or other things that work for you. Again, these are things you need to do to "fill your bucket" so that you can be a support for your girlfriend.
I would also suggest talking with her about those times when she "hates you." This needs to be done during times when she is "amazing with you." Discuss how you have felt when these incidents occur. Be mindful of how you approach these discussions. It is important to keep to specific examples, and using I messages, "I feel, I think..." Then, discuss ways that both of you can work on making these situations better.
I would also suggest utilizing a therapist or counselor to assist in this process. If she has a therapist, you can ask her how she would feel about you attending a session to assist with improving the relationship (if she isn't okay with it, then this won't be a possibility). You can also utilize couples counseling, where you both participate equally, and the specific goals would be related to your relationship.
Again, as I mentioned at the beginning, it is important for you to realize that you are not the cause of this. She would be having these problems regardless. She is probably struggling to figure out how to best navigate it. Be patient, supportive, but also take care of yourself so you can do those things.