1) Navigate to https://appstoreconnect.apple.com/access/api
2) Click Generate API Key
3) Click Generate API Key button again and in the modal window enter the following names:
Name: Deployment
Access: Admin
4) Select Download API Key in the list
5) Download p8 file
Fastlane documentation: https://docs.fastlane.tools/app-store-connect-api/