Skip to content

Commit dbc2c50

Browse files
committed
Further fix attempts
1 parent 02ae467 commit dbc2c50

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/docker.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ jobs:
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

@@ -58,7 +66,7 @@ jobs:
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
@@ -67,4 +75,4 @@ jobs:
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 }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ARG PYTHONDONTWRITEBYTECODE=1
1111

1212
WORKDIR /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)
1818
RUN apk add --no-cache ffmpeg

0 commit comments

Comments
 (0)