Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Add build metadata to build arg
Uku Taht5b5c70b82dee
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex 5d27146473..4762b22949 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -12,13 +12,6 @@ jobs:runs-on: buildjet-4vcpu-ubuntu-2004steps:- - uses: actions/checkout@v2-- - name: Extract branch name- shell: bash- run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"- id: extract_branch-- name: Docker metaid: metauses: docker/metadata-action@v4@@ -40,17 +33,15 @@ jobs:username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}- -- name: Build and push+ - name: Build and pushid: docker_builduses: docker/build-push-action@v2with:- context: .push: ${{ github.event_name != 'pull_request' }}tags: ${{ steps.meta.outputs.tags }}labels: ${{ steps.meta.outputs.labels }}- cache-from: type=registry,ref=plausible/analytics:${{ steps.extract_branch.outputs.branch }}- cache-to: type=inline- -- name: Image digest+ cache-from: type=gha+ cache-to: type=gha,mode=max+ build-args: BUILD_METADATA=${{ steps.meta.outputs.json }}+ - name: Image digestrun: echo ${{ steps.docker_build.outputs.digest }}diff --git a/lib/plausible_web/controllers/api/external_controller.ex b/lib/plausible_web/controllers/api/external_controller.exindex 543e644a57..f1c9bf2a1b 100644--- a/lib/plausible_web/controllers/api/external_controller.ex+++ b/lib/plausible_web/controllers/api/external_controller.ex@@ -66,6 +66,8 @@ defmodule PlausibleWeb.Api.ExternalController do_ -> %{}end+ build_info = System.get_env("BUILD_METADATA", "{}") |> Jason.decode!()+geo_database =case Geolix.metadata([:geolocation]) do%{geolocation: %{database_type: type}} ->@@ -77,7 +79,8 @@ defmodule PlausibleWeb.Api.ExternalController doinfo =Map.merge(version, %{- geo_database: geo_database+ geo_database: geo_database,+ build: build_info})json(conn, info)