You would be able to move before the goblin could take the Attack action
For my answer, I'm going to assume this particular goblin lost its shortbow and can only make melee attacks. Unless the goblin is only 5 feet away when it starts to move towards you, and you have readied movement under the trigger:
"If the goblin moves towards me, I move away"
you should be able to use your readied movement to run away from the goblin once it has moved at least 5 feet. It does not need to complete all of its movement before you can use your readied movement.
But if it can make an opportunity attack, that still happens
However, if you use the readied trigger:
"If the goblin steps next to me, I move away"
then the goblin would be stood next to you before you would be able to act, since according to this answer to a different question, a readied action does not interrupt its trigger but happens afterwards. This is also mentioned on PHB p. 193 (or in the corresponding part of the basic rules), under the description of the "Ready" action (emphasis mine, or rather, enkryptor's):
When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger.
Therefore, the goblin would be able to make an opportunity attack against you as you run away.
Also, if the goblin is only 5 feet away, then even if your trigger was to run away when the goblin moved towards you rather than stood next to you, it would have already moved 5 feet and would now be stood next to you, since readied actions don't interrupt their triggers. You can still run away before it makes its Attack, but it would still get an opportunity attack against you, which is much the same outcome you were trying to avoid.
As pointed out by Slagmoth in comments, if you chose only to move, say, 10 feet rather than using your whole movement, then depending on how far away the goblin was, it may still potentially catch up with you and make an Attack action against you.
Even if you did use all your movement, it may also take the Dash action to run next to you (assuming you were within 60 feet of it, even after you moved away), ready to hit you on its next turn (or with an opportunity attack if you chose to move away again without disengaging, although you would have already used up your reaction this turn so that would be on your next turn, allowing you to adjust your tactics accordingly).
NB: By "only 5 feet away", I mean "in terms of a grid, there is one unoccupied square between you and the goblin" (just in case there's any confusion about what I meant).