Preheat oven to 200°C.
Mince the onions and sauté in a saucepan over low heat with the olive oil and 1 or 2 tablespoons of water for about 15 minutes.When they start to brown, deglaze with the balsamic vinegar and add the brown sugar.Stir well and leave to caramelize for a further ten minutes, making sure the onions don't stick.Set aside. Roll out the dough and, using a small conical glass, cut out discs, then place them on a baking sheet lined with parchment paper.Press the bottom of the glass against the center of the pastry discs to create a border.Prick the center with a fork, otherwise the pastry will push the filling out of the tartlets as it puffs up. Mix the egg yolk and milk, then brush the edges of the pastry discs with the mixture.
Place a tablespoonful of caramelized onions in the center of the discs. Place a slice of goat's cheese on top and season with pepper.
Bake for 15 to 20 minutes. The edges should be golden brown.