From 4de14031051b716b12bfb49f4d252e55ff3d8b04 Mon Sep 17 00:00:00 2001 From: Benjamin Nussbaum Date: Tue, 6 May 2025 13:19:02 +0200 Subject: [PATCH] feat: show version number on welcome screen when logged in --- .github/workflows/docker-build.yml | 6 ++++++ Dockerfile | 7 +++++++ config/app.php | 13 +++++++++++++ resources/views/welcome.blade.php | 6 ++++++ 4 files changed, 32 insertions(+) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 99c408a..048db51 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -19,6 +19,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Extract version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -52,3 +56,5 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max target: production + build-args: | + APP_VERSION=${{ env.VERSION }} diff --git a/Dockerfile b/Dockerfile index 35ca026..6a9931d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,13 @@ ######################## FROM bnussbau/serversideup-php:8.3-fpm-nginx-alpine-imagick-chromium AS base +LABEL org.opencontainers.image.source=https://github.com/usetrmnl/byos_laravel +LABEL org.opencontainers.image.description="TRMNL BYOS Laravel" +LABEL org.opencontainers.image.licenses=MIT + +ARG APP_VERSION +ENV APP_VERSION=${APP_VERSION} + ENV AUTORUN_ENABLED="true" # Switch to the root user so we can do root things diff --git a/config/app.php b/config/app.php index 92fe477..0ef676e 100644 --- a/config/app.php +++ b/config/app.php @@ -130,4 +130,17 @@ return [ 'force_https' => env('FORCE_HTTPS', false), 'puppeteer_docker' => env('PUPPETEER_DOCKER', false), + /* + |-------------------------------------------------------------------------- + | Application Version + |-------------------------------------------------------------------------- + | + | This value is the version of your application, which will be used when + | displaying the version number in the UI. This is set during the Docker + | build process from the release tag. + | + */ + + 'version' => env('APP_VERSION', null), + ]; diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 1f8ddeb..d1c8bcd 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -31,4 +31,10 @@ @endif + @auth + @if(config('app.version')) + Version: {{ config('app.version') }} + @endif + @endauth