This commit is contained in:
jayjojayson 2026-02-07 12:12:01 +01:00
parent a4fa47b1c7
commit b93cdba852
9 changed files with 2154 additions and 0 deletions

46
.github/workflows/build_card.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: Build Sun Position Card
# Wann soll der Workflow starten?
on:
# 1. Automatisch bei Änderungen im Main-Branch
push:
branches:
- main
paths:
- 'src/**' # Nur wenn sich Quellcode ändert
- 'build.js' # Oder das Build-Skript
# 2. Manuell per Button ausführbar
workflow_dispatch:
# Berechtigungen setzen, damit der Bot die Datei speichern darf
permissions:
contents: write
jobs:
build-and-commit:
runs-on: ubuntu-latest
steps:
# 1. Den Code aus dem Repo holen
- name: Checkout code
uses: actions/checkout@v4
# 2. Node.js installieren (Version 20)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# 3. Das Build-Skript ausführen
- name: Run Build Script
run: node build.js
# 4. Prüfen, ob sich die Datei geändert hat und committen
# Wenn keine Änderung erkannt wird, macht dieser Schritt einfach nichts (kein Fehler)
- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "power-flux-card Auto-build"
file_pattern: dist/power-flux-card.js

26
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Upload Release Asset
# Startet nur, wenn ein neues Release veröffentlicht wird
on:
release:
types: [published]
# Schreibrechte sind notwendig für den Upload
permissions:
contents: write
jobs:
upload-asset:
runs-on: ubuntu-latest
steps:
# 1. Code auschecken (damit die Datei dist/sun-position-card.js verfügbar ist)
- name: Checkout code
uses: actions/checkout@v4
# 2. Die existierende Datei aus dem dist-Ordner an das Release anhängen
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: dist/power-flux-card.js

43
.github/workflows/static.yml vendored Normal file
View file

@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.' # docs erstmal herausgenommen
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

22
.github/workflows/validate.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Validate with HACS
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# 1. HACS-Validierung
# Prüft hacs.json und Struktur
- name: Run HACS validation
uses: hacs/action@main
with:
category: plugin