The energy transition usually encounters challenges in balancing three competing common goals of economics costs, CO2 emissions, and energy resilience (the so-called Energy Trilemma). Such trade-offs are particularly conspicuous for coastal cities, which often have more ambitious emission reduction targets and are more likely to face threats of extreme weather events such as typhoons. To tackle the Energy Trilemma of the city-level energy transition, this study develops a bottom-up multi-objective optimisation framework. The framework enables simultaneous optimising the long-term energy portfolio for a 20-year horizon and the short-term hourly dispatch strategy considering demand-side flexibility of energy storage. By setting multiple objectives, the trade-offs between three representative scenarios are evaluated via Pareto frontiers, i.e., the least-cost, the least-emissions, and the diversity-optimal scenarios. The case study in a typical coastal city, i.e., Xiamen, China, indicates that with limited local resources for solar, wind, and other renewable resources, the electricity transition would still need to rely on imported power to a large extent. Compared to the least-cost pathway, additional costs of 3.9% can help achieve a pathway with maximum energy diversity to enhance resilience, whereas 26.8% additional costs are needed to achieve the least-emissions pathway. In addition, the initial 10-year modelling results are verified by comparison with real-world actual data to further generate valuable insights into sustainable transition pathways of similar coastal cities.