Burton Borough School in Newport, which has around 1,000 pupils, reopened on Tuesday after six days of closure due to the impact of Covid cases.
Principal Krissi Carter said it had been the most challenging period at the school during the pandemic so far, with no option but to shut the school due to the lack of staff available.
She said: "Closing the school is the last thing anyone wants to do but when it comes to the safety of our students that has to be the priority.
"Operationally we could not run – we had 39 staff isolating so it was impossible to run the school."
The situation saw another switch to home-learning, with staff continuing their pattern of having to adapt to the changing circumstances.
Ms Carter said she was incredibly proud of the response of all of the staff at the school – and parents.
She said: "My staff are amazing. Flitting from face-to-face and classroom teaching to being back online again. Sometimes when the bubbles collapse we have had staff half teaching children in school and setting work for others at home.
"The admin team, the pastoral team, the medical team, the amount of work the staff and support staff have done is phenomenal.
"They get the communication out and make sure the school is clean and safe.
"The canteen staff have faced huge disruption but the work they do is amazing."
The school term is set to finish next Tuesday, with the government announcing that the bubble system will no longer be in place for the start of the September term.
However, schools have been warned to expect a rise in cases due to government relaxation of Covid restrictions.
Ms Carter praised the efforts of parents in the face of a testing few weeks.
She said: "Out parents have been so supportive. I think they completely understand how difficult it is as staff and for me as head to make that decision."
She added: "We have tried to be as transparent and as quick as we can with the communication."