Even thought you've not showed what you've attempted, this is quite straight forward. Firstly, you need to do list activate the ScriptListener - which records blocks of code for you.
After that it's basically three things. Duplicating a the original layer, rotating it x degrees and then repeating that 359 other times.
So with just your image as a layer in Photoshop and nothing else:
// Define angle and number of frames
var rotationAngle = 36; // I've set it to 36 as 360 will take 10 longer!
// rename the original
app.activeDocument.activeLayer.name = "original";
// loop over that rotationAngle number of times
for (var i = 0; i < rotationAngle; i++)
{
// Duplicate layers
// This is scriptListener code
var id1572 = charIDToTypeID( "Dplc" );
var desc350 = new ActionDescriptor();
var id1573 = charIDToTypeID( "null" );
var ref184 = new ActionReference();
var id1574 = charIDToTypeID( "Lyr " );
var id1575 = charIDToTypeID( "Ordn" );
var id1576 = charIDToTypeID( "Trgt" );
ref184.putEnumerated( id1574, id1575, id1576 );
desc350.putReference( id1573, ref184 );
var id1577 = charIDToTypeID( "Nm " );
desc350.putString( id1577, i+1 );
var id1578 = charIDToTypeID( "Vrsn" );
desc350.putInteger( id1578, 2 );
executeAction( id1572, desc350, DialogModes.NO );
}
// Loop over it AGAIN!
for (var i = 0; i < rotationAngle; i++)
{
// grab each layer in turn and make it active
var thisLayer = app.activeDocument.layers[i];
app.activeDocument.activeLayer = thisLayer;
// rotate image x degrees
var idTrnf = charIDToTypeID( "Trnf" );
var desc802 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref237 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref237.putEnumerated( idLyr, idOrdn, idTrgt );
desc802.putReference( idnull, ref237 );
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc802.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc803 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc803.putUnitDouble( idHrzn, idPxl, 0);
var idVrtc = charIDToTypeID( "Vrtc" );
var idPxl = charIDToTypeID( "#Pxl" );
desc803.putUnitDouble( idVrtc, idPxl, 0);
var idOfst = charIDToTypeID( "Ofst" );
desc802.putObject( idOfst, idOfst, desc803 );
var idAngl = charIDToTypeID( "Angl" );
var idAng = charIDToTypeID( "#Ang" );
desc802.putUnitDouble( idAngl, idAng, i );
var idIntr = charIDToTypeID( "Intr" );
var idIntp = charIDToTypeID( "Intp" );
var idNrst = charIDToTypeID( "Nrst" );
desc802.putEnumerated( idIntr, idIntp, idNrst );
executeAction( idTrnf, desc802, DialogModes.NO );
}
// Bingo you're all done