When I replaced my valve cover gasket, I used weatherstrip adhesive. I glued the gasket to the valve cover and let it dry. Then I bolted the cover to the head.
That way, if I need to remove the valve cover to adjust the valves, I don't need to replace the gasket each time..