You could simply drill a small hole near the top of the ramp, add a small washer, and screw it to the deck using a stainless screw. Contact with pt will damage certain metals. Most deck screws are coated with ceramic for this purpose so that works, too, except the head of a deck screw isn't designed to necessarily be used against a washer, it will work.
If the door stop is solid, not hollow, you could attach it to a small piece of wood by putting two small screws through the wood into the back of the stop and then attach the whole thing to the deck.