Compare commits

..

4 Commits

Author SHA1 Message Date
josh a9fe398eec Add Umami analytics script
Build and Push Image / build-push (push) Successful in 31s
Embeds the tracking.thewrightserver.net Umami script in the page head
so visits to Day Drain show up in the analytics dashboard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:27:23 -04:00
josh 9ecdfe7cd1 Strip scheme from REGISTRY_URL before tagging
Build and Push Image / build-push (push) Successful in 43s
Docker image tags must start with a hostname — a `https://` prefix in
the REGISTRY_URL variable produced `invalid reference format`. Normalize
the value in a prep step (drop http/https scheme and trailing slash) so
the workflow works whether the variable is set as a URL or a bare host.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:23:49 -04:00
josh 67ae4fbd99 Merge branch 'main' of https://gitea.thewrightserver.net/josh/WorkWeekProgress
Build and Push Image / build-push (push) Failing after 29s
2026-04-24 10:20:42 -04:00
josh 6fa9b6f8b6 Migrate CI from Jenkins to Gitea Actions
Replaces the Jenkinsfile with a .gitea/workflows/build-push.yml that
builds on pushes to main and pushes `latest` + `sha-<short>` tags to the
Gitea package registry using the REGISTRY_URL variable and
REGISTRY_TOKEN secret. Adds a docker-compose.yml that pulls the
published image for deployment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:20:31 -04:00
4 changed files with 52 additions and 54 deletions
+44
View File
@@ -0,0 +1,44 @@
name: Build and Push Image
on:
push:
branches: [main]
env:
IMAGE: josh/workweekprogress
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare build vars
id: vars
run: |
host="${{ vars.REGISTRY_URL }}"
host="${host#https://}"
host="${host#http://}"
host="${host%/}"
echo "registry=$host" >> "$GITHUB_OUTPUT"
echo "sha_short=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ steps.vars.outputs.registry }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.vars.outputs.registry }}/${{ env.IMAGE }}:latest
${{ steps.vars.outputs.registry }}/${{ env.IMAGE }}:sha-${{ steps.vars.outputs.sha_short }}
Vendored
-54
View File
@@ -1,54 +0,0 @@
pipeline {
agent any
environment {
REGISTRY = "gitea.thewrightserver.net"
IMAGE = "gitea.thewrightserver.net/josh/workweekprogress"
TAG = "${env.BUILD_NUMBER}"
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Build Image") {
steps {
sh """
docker build \
-t ${IMAGE}:${TAG} \
-t ${IMAGE}:latest \
.
"""
}
}
stage("Push Image") {
steps {
withCredentials([
usernamePassword(
credentialsId: 'gitea-registry-creds',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN'
)
]) {
sh """
echo "$GITEA_TOKEN" | docker login ${REGISTRY} \
-u "$GITEA_USER" --password-stdin
docker push ${IMAGE}:${TAG}
docker push ${IMAGE}:latest
"""
}
}
}
}
post {
cleanup {
sh "docker image prune -f"
}
}
}
+7
View File
@@ -0,0 +1,7 @@
services:
dayDrain:
image: gitea.thewrightserver.net/josh/workweekprogress:latest
container_name: day-drain
restart: unless-stopped
ports:
- "5000:5000"
+1
View File
@@ -5,6 +5,7 @@
<title>Day Drain</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<script defer src="https://tracking.thewrightserver.net/script.js" data-website-id="941f89a7-2bbc-4def-b7dd-aeace5986aa2"></script>
</head>
<body>
<div class="container">