Born on 26 March 1917 in Panadura, Ramayanayake was educated at St. John's College, Panadura and at the University of Ceylon, where he excelled in sports.
Ramayanayake joined the Ceylon Defence Force during World War II, following training he was commissioned as a Second Lieutenant in the Ceylon Engineers. During the war his unit undertook construction projects like the Pallaly Airport, the Water Supply Scheme for Trincomalee at Monkey Bridge and the Anguruwatota Bridge. Following the end of the war, he was demobilized in 1946 and joined the Department of Industries as a staff officer.
With the formation of the Ceylon Army in October 1949, he was commissioned as a Captain in the regular force in February 1950. In January 1951, Captain Ramayanayake was one of three officers selected for training at the Royal School of Military Engineering. On 1 October 1951, the 1 Field Engineer Squadron, Ceylon Engineers was formed with Major Ramayanayake as officer commanding. In July 1959, the 1 Field Engineer Squadron was raised to a field engineerregiment and was re-designated 1st Field Engineer Regiment, Ceylon Engineers. Promoted to the rank of Lieutenant Colonel in 1957, Ramayanayake was appointed its first commanding officer. Since he lead the formation of the Ceylon Engineers, Ramayanayake is referred to as the "Father of the Sri Lanka Engineers". The squadron moved to the Panagoda Cantonment and assisted in its construction and was deployed during the 1953 Hartal. He served as commanding officer of the 1st Field Engineer Regiment from October 1958 to November 1965, during which time the regiment undertook the earth works at Sugathadasa Stadium, built bridges across Galoya, in Hiniduma and Amparai. The 1st Field Engineer Regiment was deployed for internal security operations during the strikes. He was thereafter appointed commanding officer of the Ceylon Cadet Corps in 1965 and served till 1969. Promoted to Colonel, he was appointed Commander, Task Force Anti Illicit Immigration in February 1969 and served till July 1970. He retired from the Ceylon Army in March 1971 with the rank of Brigadier. He was the Chairmen of the army football team board and the Brigadier P.D. Ramanayaka Memorial Sports Ground was named after him at the regimental headquarters of the Sri Lanka Engineers. For wartime service in World War II, he had earned the Defence Medal and the War Medal 1939–1945, and for service in the Ceylon Army, he received the Queen Elizabeth II Coronation Medal, the Ceylon Armed Services Long Service Medal and the Ceylon Armed Services Inauguration Medal.
Family
He was married to Christobel Ramayanayake, they had four daughters and one son, Lalith Ramayanayake who became a Director of John Keells Group.