File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1818 runs-on : ubuntu-latest
1919 steps :
2020
21+ - name : Determine git sha to checkout
22+ uses : haya14busa/action-cond@v1
23+ id : gitsha
24+ with :
25+ cond : ${{ github.event_name == 'pull_request' }}
26+ if_true : ${{ github.event.pull_request.head.sha }}
27+ if_false : ${{ github.sha }}
28+
2129 - name : Checkout repo
2230 uses : actions/checkout@v3
2331
5866 type=sha
5967
6068 - name : Build and publish
61- uses : docker/build-push-action@v4
69+ uses : docker/build-push-action@v5
6270 with :
6371 context : .
6472 # ADDED: Platforms for multi-arch build
6775 tags : ${{ steps.meta.outputs.tags }}
6876 labels : ${{ steps.meta.outputs.labels }}
6977 build-args : |
70- COMMIT_HASH=${{ github.sha }}
78+ COMMIT_HASH=${{ steps.gitsha.outputs.value }}
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ ARG PYTHONDONTWRITEBYTECODE=1
1111
1212WORKDIR /app
1313
14- # Only create the file if COMMIT_HASH is not empty
15- RUN [ -n "$ COMMIT_HASH" ] && echo "Commit: $COMMIT_HASH" && echo "$COMMIT_HASH" > /app/commit_hash || echo "[Debug] No hash provided."
14+ ARG COMMIT_HASH
15+ ENV APP_COMMIT=${ COMMIT_HASH}
1616
1717# 1. Install Alpine-native tools (FFmpeg and Python use these)
1818RUN apk add --no-cache ffmpeg
You can’t perform that action at this time.
0 commit comments