Earlier quoted context omitted.
I recently did this for one of my GitHub repos which runs several test suites (cumulatively taking >1h). If your actions are slow, pay attention to the IAM role session duration. The maximum duration with role chaining is 1 hour. In the end your credentials need to outlive your CI/CD actions.
I believe the max duration of an assumed role session is 12 hours, but this can be changed per-role.
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_te...
> Role chaining limits your AWS CLI or AWS API role session to a maximum of one hour.