Switch to master branch + Gitea Actions
- Move CI/release workflows from .github/workflows to .gitea/workflows (Gitea Actions), targeting the master branch. - docker-publish: push to the Gitea container registry (git.finalfactory.de) with a lowercased image name; login via github.token or a PACKAGES_TOKEN secret. - version-tag: gitea-actions bot identity; optional RELEASE_TOKEN to re-trigger the image build. - Update README/CLAUDE.md/Unraid template/build-and-push.ps1 to the Gitea registry + master. Claude-Session: https://claude.ai/code/session_01WujdMtMJPbxDpDnMeK22rr
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
# Build + test on push/PR. Integration tests spin a TimescaleDB via Testcontainers, which needs
|
||||
# a Docker daemon — available on the ubuntu-latest runner.
|
||||
# Gitea Actions: build + test on push/PR. Integration tests spin a TimescaleDB via Testcontainers,
|
||||
# so the act_runner label used here must be a Docker-capable runner (docker-in-docker or a host
|
||||
# runner with a reachable Docker socket).
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
@@ -0,0 +1,52 @@
|
||||
# Gitea Actions: builds and pushes the multi-arch MeterVault image on a vX.Y.Z tag (SDD §11).
|
||||
# Pushes to the Gitea container registry on this host. Requires a Docker-capable act_runner and
|
||||
# a token with package:write — the built-in ${{ github.token }} works if the runner is configured
|
||||
# to allow package writes; otherwise set a PACKAGES_TOKEN secret (a PAT with write:package).
|
||||
name: docker-publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
REGISTRY: git.finalfactory.de
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Derive version and lowercase image name
|
||||
id: meta
|
||||
run: |
|
||||
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
echo "image=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the Gitea registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN || github.token }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}
|
||||
${{ env.REGISTRY }}/${{ steps.meta.outputs.image }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -1,12 +1,12 @@
|
||||
# Turns an edit to the VERSION file on main into an annotated vX.Y.Z tag (the "easy release"
|
||||
# ergonomics from MQTTower). The tag then triggers docker-publish.yml. A tag pushed with
|
||||
# GITHUB_TOKEN would not trigger other workflows, so this job uses a PAT if provided
|
||||
# (RELEASE_PAT), otherwise it still tags and you can trigger the image build manually.
|
||||
# Gitea Actions: turns an edit to the VERSION file on master into an annotated vX.Y.Z tag (the
|
||||
# "easy release" ergonomics from MQTTower). The tag then triggers docker-publish.yml. Gitea's
|
||||
# built-in token may not re-trigger tag workflows, so provide a PAT secret (RELEASE_TOKEN) with
|
||||
# repo write if you want the image build to fire automatically; otherwise run it via workflow_dispatch.
|
||||
name: version-tag
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [master]
|
||||
paths:
|
||||
- "VERSION"
|
||||
|
||||
@@ -24,11 +24,14 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# A PAT with repo write lets the pushed tag re-trigger docker-publish; falls back to the
|
||||
# built-in token (which tags but may not re-trigger).
|
||||
token: ${{ secrets.RELEASE_TOKEN || github.token }}
|
||||
|
||||
- name: Create tag if VERSION is the new highest semver
|
||||
env:
|
||||
GIT_AUTHOR_NAME: github-actions[bot]
|
||||
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
|
||||
GIT_AUTHOR_NAME: gitea-actions[bot]
|
||||
GIT_AUTHOR_EMAIL: gitea-actions[bot]@noreply.localhost
|
||||
run: |
|
||||
set -euo pipefail
|
||||
RAW="$(tr -d ' \r\n' < VERSION)"
|
||||
@@ -1,50 +0,0 @@
|
||||
# Builds and pushes the multi-arch MeterVault image on a vX.Y.Z tag (SDD §11).
|
||||
# Default registry is GHCR; change REGISTRY/IMAGE below (one place) to target the FinalFactory
|
||||
# registry (e.g. REGISTRY: git.finalfactory.de) and set the matching login secrets.
|
||||
name: docker-publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE: ${{ github.repository }} # ghcr.io/<owner>/metervault
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Derive version
|
||||
id: ver
|
||||
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.ver.outputs.version }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -96,4 +96,4 @@ These CSVs are the German-dialect *Energiebilanz* spreadsheet export and define
|
||||
|
||||
## Git
|
||||
|
||||
Remote `origin` is `https://git.finalfactory.de/FinalFactory/MeterVault.git` (default branch `main`).
|
||||
Remote `origin` is `https://git.finalfactory.de/FinalFactory/MeterVault.git` (Gitea; default branch `master`). CI/release is **Gitea Actions** under `.gitea/workflows/` — edit `VERSION` on `master` to tag + publish the image to the Gitea container registry.
|
||||
|
||||
@@ -74,8 +74,10 @@ Architecture, project layout and conventions live in [`CLAUDE.md`](CLAUDE.md).
|
||||
|
||||
## Releasing
|
||||
|
||||
Edit the [`VERSION`](VERSION) file on `main`; CI tags `vX.Y.Z` and builds/pushes a multi-arch image
|
||||
(`.github/workflows/`). Locally: `pwsh deploy/build-and-push.ps1 -Push`.
|
||||
Edit the [`VERSION`](VERSION) file on `master`; Gitea Actions tags `vX.Y.Z` and builds/pushes a
|
||||
multi-arch image to the Gitea container registry (`.gitea/workflows/`). Locally:
|
||||
`pwsh deploy/build-and-push.ps1 -Registry git.finalfactory.de -Image finalfactory/metervault -Push`.
|
||||
Requires a Docker-capable `act_runner`; the image build itself is self-contained.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Local convenience: build the multi-arch MeterVault image and push it.
|
||||
# Usage: ./deploy/build-and-push.ps1 -Registry ghcr.io -Image finalfactory/metervault
|
||||
# Usage: ./deploy/build-and-push.ps1 -Registry git.finalfactory.de -Image finalfactory/metervault -Push
|
||||
# Version is read from the VERSION file; images are tagged :<version> and :latest.
|
||||
|
||||
param(
|
||||
[string]$Registry = "ghcr.io",
|
||||
[string]$Registry = "git.finalfactory.de",
|
||||
[string]$Image = "finalfactory/metervault",
|
||||
[string[]]$Platforms = @("linux/amd64", "linux/arm64"),
|
||||
[switch]$Push
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
separately, or point ConnectionStrings__Default at an existing instance). -->
|
||||
<Container version="2">
|
||||
<Name>MeterVault</Name>
|
||||
<Repository>ghcr.io/finalfactory/metervault:latest</Repository>
|
||||
<Registry>https://ghcr.io/finalfactory/metervault</Registry>
|
||||
<Repository>git.finalfactory.de/finalfactory/metervault:latest</Repository>
|
||||
<Registry>https://git.finalfactory.de/FinalFactory/-/packages/container/metervault</Registry>
|
||||
<Network>bridge</Network>
|
||||
<Shell>bash</Shell>
|
||||
<Privileged>false</Privileged>
|
||||
<Overview>Self-hosted energy & utility metering: ingest from Home Assistant/Tasmota/MQTT, normalize to consumption, and produce cost dashboards. Needs a TimescaleDB instance.</Overview>
|
||||
<Category>HomeAutomation: Tools: Productivity:</Category>
|
||||
<WebUI>http://[IP]:[PORT:8080]/</WebUI>
|
||||
<Icon>https://raw.githubusercontent.com/FinalFactory/MeterVault/main/docs/icon.png</Icon>
|
||||
<Icon>https://git.finalfactory.de/FinalFactory/MeterVault/raw/branch/master/docs/icon.png</Icon>
|
||||
|
||||
<Config Name="WebUI Port" Target="8080" Default="8080" Mode="tcp" Description="HTTP port" Type="Port" Display="always" Required="true">8080</Config>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user