diff --git a/.gitea/workflows/build-push.yml b/.gitea/workflows/build-push.yml index 35d69c8..b0a2242 100644 --- a/.gitea/workflows/build-push.yml +++ b/.gitea/workflows/build-push.yml @@ -53,6 +53,7 @@ jobs: - name: Build image run: | docker build --no-cache \ + --build-arg COMMIT_SHA=${{ steps.sha.outputs.short_sha }} \ -t "${IMAGE}:${{ steps.sha.outputs.short_sha }}" \ -t "${IMAGE}:latest" \ . diff --git a/Dockerfile b/Dockerfile index 7b623f6..aad1f29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,10 @@ RUN pnpm install --frozen-lockfile --ignore-scripts # Copy source COPY . . +# Pass commit SHA at build time +ARG COMMIT_SHA=dev +ENV COMMIT_SHA=${COMMIT_SHA} + # Build Next.js app RUN pnpm run build