From 8ecf5338d58cf842f44113258429079c9360890e Mon Sep 17 00:00:00 2001 From: poslop Date: Wed, 9 Sep 2026 18:22:31 -0500 Subject: [PATCH 1/8] CI: build dev image on dev branch pushes (palette-dev deploy) --- .gitea/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index ebc20ad..ec1b031 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [main] + branches: [main, dev] tags: ['v*'] pull_request: @@ -23,8 +23,8 @@ jobs: run: go test -v ./... docker: - # build & push image only on tags (releases) - if: startsWith(github.ref, 'refs/tags/') + # build & push image only on tags (releases) and dev branch (dev deploy) + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/dev' needs: test runs-on: [debian-latest] env: @@ -57,6 +57,6 @@ jobs: push: true tags: | git.archfox.org/poslop/palette:${{ gitea.ref_name }} - git.archfox.org/poslop/palette:latest + ${{ startsWith(gitea.ref, 'refs/tags/') && 'git.archfox.org/poslop/palette:latest' || '' }} cache-from: type=gha cache-to: type=gha,mode=max From 65ed0c70437e8e1377d72d705e1fd6f4fc187c2a Mon Sep 17 00:00:00 2001 From: agent Date: Wed, 9 Sep 2026 18:27:57 -0500 Subject: [PATCH 2/8] Show actual version in topbar instead of hardcoded beta (Fixes #93) --- .gitea/workflows/ci.yml | 1 + Dockerfile | 3 ++- internal/web/templates/layout.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index ec1b031..b62111e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -55,6 +55,7 @@ jobs: with: context: . push: true + build-args: VERSION=${{ gitea.ref_name }} tags: | git.archfox.org/poslop/palette:${{ gitea.ref_name }} ${{ startsWith(gitea.ref, 'refs/tags/') && 'git.archfox.org/poslop/palette:latest' || '' }} diff --git a/Dockerfile b/Dockerfile index 770886b..e50b7a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ COPY go.mod go.sum ./ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /palette ./cmd/palette +ARG VERSION=dev +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X palette/internal/web.Version=${VERSION}" -o /palette ./cmd/palette # ---- runtime stage ---- FROM alpine:3.20 diff --git a/internal/web/templates/layout.html b/internal/web/templates/layout.html index d63bb50..a958df9 100644 --- a/internal/web/templates/layout.html +++ b/internal/web/templates/layout.html @@ -13,7 +13,7 @@ {{define "topbar"}}
- +