(1).With a file open in Photoshop — it does not matter if the image has to be rotated or not; you just need to be in the Photoshop application — open your Actions window (Window > Actions).
(2). At the top right of the Actions box or palette, there is an arrow. Click here to open more options and select New Action.
(3). Give a Name to your Action and assign a Function Key (I give a name “rotate 90ccw” and assigned the F11 key to your action). If you like, create a new “Set” folder in advance to store related actions.
(4).Now you are ready to record each step you make. Either select Record on the window that is still open or simply click on the round record button at the bottom of the palette (it will turn red when you are in Record mode). Go to Image > Rotate Canvas > Rotate 90º CCW. Your image should rotate at 90 degrees counter-clockwise (see image below). Next, go back to your Actions options and select Stop Recording or simply click on the square button at the bottom of the palette.
5. You have just recorded your Action. To test it, press your F11 key, and the image will rotate again. The same action can now be applied to any image you open in Photoshop.