Skip to content

Commit c1f6da5

Browse files
committed
set build info
1 parent 6bdf138 commit c1f6da5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/publish-webapp.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ jobs:
5656
5757
echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT"
5858
59+
- name: 📝 Set the build info
60+
id: set_build_info
61+
run: |
62+
tag=${{ steps.get_tag.outputs.tag }}
63+
if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
64+
echo "BUILD_APP_VERSION=${tag}" >> "$GITHUB_OUTPUTS"
65+
fi
66+
echo "BUILD_GIT_SHA=${{ github.sha }}" >> "$GITHUB_OUTPUTS"
67+
echo "BUILD_GIT_REF_NAME=${{ github.ref_name }}" >> "$GITHUB_OUTPUTS"
68+
echo "BUILD_TIMESTAMP_SECONDS=$(date +%s)" >> "$GITHUB_OUTPUTS"
69+
5970
- name: 🐙 Login to GitHub Container Registry
6071
uses: docker/login-action@v3
6172
with:
@@ -70,3 +81,8 @@ jobs:
7081
platforms: linux/amd64,linux/arm64
7182
tags: ${{ steps.set_tags.outputs.image_tags }}
7283
push: true
84+
build-args: |
85+
BUILD_APP_VERSION=${{ steps.set_build_info.outputs.BUILD_APP_VERSION }}
86+
BUILD_GIT_SHA=${{ steps.set_build_info.outputs.BUILD_GIT_SHA }}
87+
BUILD_GIT_REF_NAME=${{ steps.set_build_info.outputs.BUILD_GIT_REF_NAME }}
88+
BUILD_TIMESTAMP_SECONDS=${{ steps.set_build_info.outputs.BUILD_TIMESTAMP_SECONDS }}

docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ COPY --from=builder --chown=node:node /triggerdotdev/scripts ./scripts
8282
COPY --from=builder /usr/local/bin/goose /usr/local/bin/goose
8383
COPY --from=builder --chown=node:node /triggerdotdev/internal-packages/clickhouse/schema /triggerdotdev/internal-packages/clickhouse/schema
8484

85+
# Build info
86+
ARG BUILD_APP_VERSION
87+
ARG BUILD_GIT_SHA
88+
ARG BUILD_GIT_REF_NAME
89+
ARG BUILD_TIMESTAMP_SECONDS
90+
ENV BUILD_APP_VERSION=${BUILD_APP_VERSION} \
91+
BUILD_GIT_SHA=${BUILD_GIT_SHA} \
92+
BUILD_GIT_REF_NAME=${BUILD_GIT_REF_NAME} \
93+
BUILD_TIMESTAMP_SECONDS=${BUILD_TIMESTAMP_SECONDS}
94+
8595
EXPOSE 3000
8696

8797
USER node

0 commit comments

Comments
 (0)