Today I had an accident with a truck stopped on the roadside for doing some road work with no signs showing that. Only the flashers were on.
My question is Should that truck have had. Only the hazards were on. I live in the state of Georgia.
Almost everywhere, in any circumstances, it is the driver's responsibility to operate their vehicle so as not to get in an accident.
When two drivers collide, responsibility can be divided among them depending on the details.
However, when a driver hits a stopped object (including another vehicle), it is always the driver's fault for not operating his vehicle safely.
It is possible the other vehicle may also receive a minor parking ticket or similar infraction for stopping on a shoulder or other invalid place. But that citation will not do anything at all to relieve your responsibility to operate your car without hitting obstacles.
You say the vehicle you hit was stopped "for doing some roadwork"; I assume, therefore, it was a highway maintenance vehicle.
Georgia's Move Over Law states, in part:
(b) The operator of a motor vehicle approaching a stationary towing or recovery vehicle or a stationary highway maintenance vehicle that is displaying flashing yellow, amber, or red lights shall approach the vehicle with due caution and shall, absent any other direction by a peace officer, proceed as follows:
(1) Make a lane change into a lane not adjacent to the towing, recovery, or highway maintenance vehicle if possible in the existing safety and traffic conditions; or
(2) If a lane change under paragraph (1) of this subsection would be impossible, prohibited by law, or unsafe, reduce the speed of the motor vehicle to a reasonable and proper speed for the existing road and traffic conditions, which speed shall be less than the posted speed limit, and be prepared to stop.
Georgia law states that you should have been prepared to stop if the highway maintenance vehicle had its lights flashing, which you indicate it did.
Most, if not all states, have similar "move over laws." Note that some states, such as Louisiana, define any stopped vehicle with flashing lights as an "emergency vehicle" requiring extra caution by drivers.
One additional note, hitting any stationary vehicle with yours will generally be considered negligence on your part and result in a citation and other consequences.