diff --git a/.github/workflows/publish-webapp.yml b/.github/workflows/publish-webapp.yml index 246a8ea31..caf7d7416 100644 --- a/.github/workflows/publish-webapp.yml +++ b/.github/workflows/publish-webapp.yml @@ -56,6 +56,17 @@ jobs: echo "image_tags=${image_tags}" >> "$GITHUB_OUTPUT" + - name: 📝 Set the build info + id: set_build_info + run: | + tag=${{ steps.get_tag.outputs.tag }} + if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then + echo "BUILD_APP_VERSION=${tag}" >> "$GITHUB_OUTPUTS" + fi + echo "BUILD_GIT_SHA=${{ github.sha }}" >> "$GITHUB_OUTPUTS" + echo "BUILD_GIT_REF_NAME=${{ github.ref_name }}" >> "$GITHUB_OUTPUTS" + echo "BUILD_TIMESTAMP_SECONDS=$(date +%s)" >> "$GITHUB_OUTPUTS" + - name: 🐙 Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -70,3 +81,8 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.set_tags.outputs.image_tags }} push: true + build-args: | + BUILD_APP_VERSION=${{ steps.set_build_info.outputs.BUILD_APP_VERSION }} + BUILD_GIT_SHA=${{ steps.set_build_info.outputs.BUILD_GIT_SHA }} + BUILD_GIT_REF_NAME=${{ steps.set_build_info.outputs.BUILD_GIT_REF_NAME }} + BUILD_TIMESTAMP_SECONDS=${{ steps.set_build_info.outputs.BUILD_TIMESTAMP_SECONDS }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 210de7f30..86a77b5a2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -82,6 +82,16 @@ COPY --from=builder --chown=node:node /triggerdotdev/scripts ./scripts COPY --from=builder /usr/local/bin/goose /usr/local/bin/goose COPY --from=builder --chown=node:node /triggerdotdev/internal-packages/clickhouse/schema /triggerdotdev/internal-packages/clickhouse/schema +# Build info +ARG BUILD_APP_VERSION +ARG BUILD_GIT_SHA +ARG BUILD_GIT_REF_NAME +ARG BUILD_TIMESTAMP_SECONDS +ENV BUILD_APP_VERSION=${BUILD_APP_VERSION} \ + BUILD_GIT_SHA=${BUILD_GIT_SHA} \ + BUILD_GIT_REF_NAME=${BUILD_GIT_REF_NAME} \ + BUILD_TIMESTAMP_SECONDS=${BUILD_TIMESTAMP_SECONDS} + EXPOSE 3000 USER node