Refactor CI workflow to update version.py with build timestamp in Dockerfile

This commit is contained in:
SergeantPanda 2025-04-27 18:53:39 -05:00
parent a81daaea44
commit 07edf270fb
2 changed files with 13 additions and 11 deletions

View file

@ -50,15 +50,6 @@ jobs:
TIMESTAMP=$(date -u +'%Y%m%d%H%M%S')
echo "timestamp=${TIMESTAMP}" >> $GITHUB_OUTPUT
# Update the timestamp in version.py
echo "Updating timestamp to ${TIMESTAMP} in version.py"
sed -i "s|__timestamp__ = None.*|__timestamp__ = '${TIMESTAMP}' # Set during CI/CD build process|" version.py
cat version.py # Verify the file was updated correctly
# Make the version.py change part of the Docker build context
git add version.py
git commit -m "Update build timestamp [skip ci]" || echo "No changes to commit"
- name: Extract version info
id: version
run: |
@ -111,4 +102,5 @@ jobs:
build-args: |
BRANCH=${{ github.ref_name }}
REPO_URL=https://github.com/${{ github.repository }}
TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
file: ./docker/Dockerfile