Fix current commit sha on Docker CI images

This commit is contained in:
Reckless_Satoshi 2022-07-16 07:01:45 -07:00
parent 834733cb61
commit 7d22dbd26d
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 9 additions and 0 deletions

View File

@ -52,6 +52,10 @@ jobs:
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Save Commit Long Hash to TXT File'
run: |
echo ${{ steps.commit.outputs.long }}>"commit_sha.txt"
- name: 'Build and push Docker image'
uses: docker/build-push-action@v3
with:

View File

@ -118,6 +118,11 @@ def get_commit_robosats():
commit = os.popen('git log -n 1 --pretty=format:"%H"')
commit_hash = commit.read()
# .git folder is included in .dockerignore. But automatic build will drop in a commit_sha.txt file on root
if commit_hash == None or commit_hash =="":
with open("commit_sha.txt") as f:
commit_hash = f.read()
return commit_hash
premium_percentile = {}