You should be using JWT authentication to your Dev Hub in a continuous integration context. That's exactly the use case it is intended for, and there is not a suitable alternative that provides the same security profile.
The path to the key file that you supply to
sfdx force:auth:jwt:grant is the path to the key file in the container environment on your server; the key file itself is stored in encrypted form in your repository and then decrypted during the CI process. The path on your local machine is irrelevant because you only refer to paths on the server environment in your CI setup.
Here is an example from one of my projects of how this works on CircleCI. Note that the encrypted key file is stored in the Git repo as
assets/server.key.enc, and the encryption passphrase is stored in the CI environment variable
$KEY. Your desired username is stored in the CI variable
$USERNAME and the consumer key of your connected app in
openssl aes-256-cbc -k $KEY -in assets/server.key.enc -out assets/server.key -d -md sha256
sfdx force:auth:jwt:grant --clientid $CONSUMERKEY --jwtkeyfile assets/server.key --username $USERNAME --setdefaultdevhubusername -a DevHub
Note that we decrypt the file stored under version control in
assets to a specific location we specify,
assets/server.key. That is then the path we supply to
There is some complexity here, but the setup and overall flow is very well documented. I strongly encourage you to read Authorize an Org Using the JWT-Based Flow from the Salesforce DX Developer Guide, along with all of the linked documentation from that page, and the relevant Trailhead module (which uses TravisCI).