use a Deploy Key in checkupdates gitlab ci job
The checkupdates job currently requires a Developer API Key. Since it only uses it to push commits, it can be replaced by a Deploy Key, which has much less access. There is already code for getting the Deploy Key out of GitLab CI Variables in fdroidserver/nightly.py and using it to push commits but its acually quite simple:
- put Deploy Key SSH private key into CI variable
- write out Deploy Key to standard SSH key location
os.makedirs(os.path.join(os.getenv('HOME'), '.ssh'), exist_ok=True)
with open(os.path.join(os.getenv('HOME'), '.ssh', 'key'), 'w') as fp:
fp.write(os.getenv('DEPLOY_KEY'))
- push commits to ssh URL