Ortega was born 1734 at Zelaya, Guanajuanto, Mexico, where he worked as a warehouse clerk. On October 1, 1755 he enlisted and served at the Presidio at Misión Nuestra Señora de Loreto. In 1759 Ortega married María Antonia Victoria Carrillo, who was born 1741. They eventually had ten children.
Some time Ortega left the army to mine in Baja California, and became alcalde (mayor), but later rejoined the army.
Sergeant Ortega was on Gaspar de Portolà's 2nd land expedition to Alta California in 1769. He was the chief scout on this expedition, which discovered San Francisco Bay, and was probably the first to see it.
In 1773 he became Lieutenant and Commandant of the Presidio of San Diego, a post he held until 1781. Previously he was Acting Commandant from July 1771 in the absence of Pedro Fages. As Commandante he went with Fray Lausen and twelve soldiers to explore the site which became Mission San Juan Capistrano. Ortega was a favorite of the missionaries, including Junípero Serra.
In the spring of 1782, Ortega was on the expedition that founded Mission San Buenaventura and the Presidio of Santa Barbara. Ortega became the first Commandant of the Presidio of Santa Barbara that year, and remained until 1784. During 1787–1791 he was Commandant of the Presidio of Monterey, and in 1792 the Commandant of the Presidio in Loreto. In 1795 he retired as brevet captain with 40 years of service.
Ortega was given a "land concession" in 1794, which he named Nuestra Señora del Refugio (Rancho Refugio) near Santa Barbara. He built his ranch here, but didn't enjoy it long. In 1798 Ortega fell off a horse and died at the Indian village of Casil at Refugio beach. He was buried at Mission Santa Barbara on February 3, 1798.