City upon a Hill
"The City upon a Hill" is a phrase derived from the teaching of salt and light in Jesus's Sermon on the Mount.  Its use in political rhetoric in United States politics is that of a declaration of American exceptionalism to refer to America acting as a "beacon of hope" for the world.

"A Model of Christian Charity"
This scripture was cited at the end of Puritan John Winthrop's lecture or treatise, "A Model of Christian Charity" delivered on March 21, 1630, at Holyrood Church in Southampton before his first group of Massachusetts Bay colonists embarked on the ship Arbella to settle Boston. In quoting Matthew's Gospel (5:14) in which Jesus warns, "a city on a hill cannot be hid," Winthrop warned his fellow Puritans that their new community would be "as a city upon a hill, the eyes of all people are upon us", meaning, if the Puritans failed to uphold their covenant with God, then their sins and errors would be exposed for all the world to see: "So that if we shall deal falsely with our God in this work we have undertaken and so cause him to withdraw his present help from us, we shall be made a story and a byword through the world".
Winthrop's lecture was forgotten for nearly two hundred years until the Massachusetts Historical Society published it in 1838. It remained an obscure reference for more than another century until Cold War era historians and political leaders reinterpreted the event, crediting Winthrop's text, erroneously, as the foundational document of the idea of American exceptionalism. More recently, Princeton historian Dan T. Rogers has corrected the record, explaining that there was no grand sense of destiny among the first Puritans to settle Boston. They carried no ambitions to build a New Jerusalem. They did not name their new home Zion, or Canaan, the promised land of milk and honey. They sought only a place to uphold their covenant with God, free from the interference they experienced in England. By the second generation of settlement, New England was a backwater in the Protestant Reformation, an inconsequential afterthought to the Puritan Commonwealth in England and the wealthier Dutch Republic. In truth, America's sense of destiny came generations later.Winthrop's warning that "we will become a story" has been fulfilled several times in the four centuries since, as described in Wayward Puritans: A Study in the Sociology of Deviance by Kai T. Erikson in 1966.

Use in American politics
On 9 January 1961, President-elect John F. Kennedy quoted the phrase during an address delivered to the General Court of Massachusetts:
... I have been guided by the standard John Winthrop set before his shipmates on the flagship Arabella three hundred and thirty-one years ago, as they, too, faced the task of building a new government on a perilous frontier. "We must always consider", he said, "that we shall be as a city upon a hill—the eyes of all people are upon us". Today the eyes of all people are truly upon us—and our governments, in every branch, at every level, national, state and local, must be as a city upon a hill—constructed and inhabited by men aware of their great trust and their great responsibilities. For we are setting out upon a voyage in 1961 no less hazardous than that undertaken by the Arabella in 1630. We are committing ourselves to tasks of statecraft no less awesome than that of governing the Massachusetts Bay Colony, beset as it was then by terror without and disorder within. History will not judge our endeavors—and a government cannot be selected—merely on the basis of color or creed or even party affiliation. Neither will competence and loyalty and stature, while essential to the utmost, suffice in times such as these. For of those to whom much is given, much is required ...
On November 3, 1980, Ronald Reagan referred to the same event and image in his Election Eve Address "A Vision for America".  Reagan was reported to have been inspired by author Manly P. Hall and his book The Secret Destiny of America, which alleged a secret order of philosophers had created the idea of America as a country for religious freedom and self-governance.
I have quoted John Winthrop's words more than once on the campaign trail this year—for I believe that Americans in 1980 are every bit as committed to that vision of a shining city on a hill, as were those long ago settlers ...
These visitors to that city on the Potomac do not come as white or black, red or yellow; they are not Jews or Christians; conservatives or liberals; or Democrats or Republicans. They are Americans awed by what has gone before, proud of what for them is still… a shining city on a hill.
Reagan would reference this concept through multiple speeches; notably again in his January 11, 1989, farewell speech to the nation:

I've spoken of the shining city all my political life, but I don't know if I ever quite communicated what I saw when I said it. But in my mind it was a tall, proud city built on rocks stronger than oceans, wind-swept, God-blessed, and teeming with people of all kinds living in harmony and peace; a city with free ports that hummed with commerce and creativity. And if there had to be city walls, the walls had doors and the doors were open to anyone with the will and the heart to get here. That's how I saw it, and see it still.
U.S. Senator Barack Obama also made reference to the topic in his commencement address on June 2, 2006, at the University of Massachusetts Boston:
It was right here, in the waters around us, where the American experiment began. As the earliest settlers arrived on the shores of Boston and Salem and Plymouth, they dreamed of building a City upon a Hill. And the world watched, waiting to see if this improbable idea called America would succeed.
More than half of you represent the very first member of your family to ever attend college. In the most diverse university in all of New England, I look out at a sea of faces that are African-American and Hispanic-American and Asian-American and Arab-American. I see students that have come here from over 100 different countries, believing like those first settlers that they too could find a home in this City on a Hill—that they too could find success in this unlikeliest of places.
In 2016, 2012 Republican presidential candidate Mitt Romney incorporated the idiom into a condemnation of Donald Trump's 2016 presidential campaign:

His domestic policies would lead to recession; his foreign policies would make America and the world less safe. He has neither the temperament nor the judgment to be president, and his personal qualities would mean that America would cease to be a shining city on a hill.
During the 2016 presidential race, Texas Senator Ted Cruz used the phrase during his speech announcing the suspension of his campaign. President Barack Obama also alluded to President Ronald Reagan's use of the phrase during his speech at the Democratic National Convention the same year, as he proposed a vision of America in contrast to that of Republican presidential candidate Donald Trump.In 2017, former FBI Director James Comey used the phrase in testimony before the Senate Intelligence Committee on the investigation into Russian interference in the 2016 U.S. presidential election:
...[W]e have this big, messy, wonderful country where we fight with each other all the time, but nobody tells us what to think, what to fight about, what to vote for, except other Americans, and that's wonderful and often painful. But we're talking about a foreign government that [...] tried to shape the way we think, we vote, we act. [...] [They]'re going to try to run it down and dirty it up as much as possible. That's what this is about. And they will be back, because we remain — as difficult as we can be with each other, we remain that shining city on the hill, and they don't like it.
On November 10, 2020, Secretary of State Mike Pompeo used the phrase while delivering an address at the inauguration of the Ronald Reagan Institute Center for Freedom and Democracy.
...But I am equally confident that America will overcome any challenge, from Communist China to the terrorist regime in Tehran.
Because that’s what free people do.  We come together; we solve problems; we win, they lose; and we execute our foreign policy confident that we are that shining city on a hill.Senator Amy Klobuchar used the phrase during opening remarks at the presidential inauguration of Joe Biden.Chair Bennie Thompson of the United States House Select Committee on the January 6 Attack used the phrase in his opening remarks to the first day of hearing on June 9.

Use in Australian politics
In Australian politics, the similar phrase "the light on the hill" was famously used in a 1949 conference speech by Prime Minister Ben Chifley, and as a consequence this phrase is used to describe the objective of the Australian Labor Party. It has often been referenced by both journalists and political leaders in that context since this time.

Use in Augustine and Roman Catholic politics
Use in hymns
The phrase is used in the hymn "Now, Saviour now, Thy love impart". written by Charles Wesley.

See also
American civil religion
American exceptionalism
Christian Dominionism
Empire of Liberty
Manifest destiny
New Jerusalem
Replacement Theology
Safed in Israel, considered by some to have been the city Jesus had in mind
Speeches and debates of Ronald Reagan
American Dream
The New Colossus

References
Notes
Further reading
Rodgers, Daniel T. (2018). As a City on a Hill: The Story of America's Most Famous Lay Sermon. Princeton University Press. ISBN 978-0-691-18437-1.
Gamble, Richard M. (2012).  In Search of the City on a Hill: The Making and Unmaking of an American Myth Continuum. ISBN 978-1441162328.
Edward O’Reilly (December 5, 2018). "John Winthrop's "City upon a hill" Sermon and an "Erasure of Collective Memory"". New-York Historical Society. Retrieved February 18, 2019.
Carter Wilkie (January 17, 2019). "How modern leaders got John Winthrop's 'City on a Hill' wrong: A call for humility has become the battle cry for American exceptionalism". Commonwealth Magazine. Retrieved August 2, 2021.
Abram Van Engen (2020). City on a Hill: A History of American Exceptionalism. Yale University Press.
Matthew Rowley (2021). "Reverse-Engineering the Covenant: Moses, Massachusetts Bay and the Construction of a City on a Hill". Journal of the Bible and its Reception, 8, no. 2.