3 Commits

Author SHA1 Message Date
d6364fc975 docs: Update to new repo name 2025-07-21 00:07:44 +02:00
7ff39ea252 ci: remove image url 2025-07-21 00:01:53 +02:00
b61de80e8a ci: Add placeholder appsettings.json and include index page 2025-07-20 23:56:53 +02:00
2 changed files with 71 additions and 32 deletions

View File

@@ -3,7 +3,7 @@ name: Build and Deploy
on: on:
push: push:
branches: branches:
- master # Change to your default branch if different - master
workflow_dispatch: workflow_dispatch:
inputs: inputs:
environment: environment:
@@ -28,7 +28,7 @@ on:
jobs: jobs:
build: build:
runs-on: self-hosted # Ensure your self-hosted runner is configured runs-on: self-hosted
environment: ${{ github.event.inputs.environment || 'prod' }} environment: ${{ github.event.inputs.environment || 'prod' }}
steps: steps:
- name: Get Current User - name: Get Current User
@@ -43,7 +43,7 @@ jobs:
- name: Set up .NET - name: Set up .NET
uses: actions/setup-dotnet@v2 uses: actions/setup-dotnet@v2
with: with:
dotnet-version: '9.0' # Change to your required .NET version dotnet-version: '9.0'
- name: Restore .NET Dependencies - name: Restore .NET Dependencies
run: dotnet restore ./HomeApi.sln run: dotnet restore ./HomeApi.sln
@@ -74,6 +74,24 @@ jobs:
} else { } else {
Write-Host "ChromeHeadlessShell not found in published output" Write-Host "ChromeHeadlessShell not found in published output"
} }
# Check wwwroot and manually copy if missing
- name: Ensure wwwroot is Included
run: |
if (-not (Test-Path -Path "./output/dotnet/wwwroot")) {
Write-Host "wwwroot folder not found in published output, manually copying..."
# Check if wwwroot exists in project directory
$sourceWwwroot = "./HomeApi/wwwroot"
if (Test-Path -Path $sourceWwwroot) {
Write-Host "Found wwwroot directory in source, copying..."
New-Item -ItemType Directory -Path "./output/dotnet/wwwroot" -Force
Copy-Item -Path "$sourceWwwroot/*" -Destination "./output/dotnet/wwwroot" -Recurse -Force
} else {
Write-Host "WARNING: Could not find wwwroot in source directory!"
}
}
- name: Generate SemVer version - name: Generate SemVer version
if: ${{ github.event.inputs.create_release != 'false' }} if: ${{ github.event.inputs.create_release != 'false' }}
@@ -81,13 +99,12 @@ jobs:
uses: ietf-tools/semver-action@v1 uses: ietf-tools/semver-action@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
branch: master # ← change to "main" if that's your default branch: master
patchAll: true patchAll: true
# fallbackTag: v0.0.1 # ← optionally bootstrap from an existing tag
- name: Create GitHub Release - name: Create GitHub Release
if: ${{ github.event.inputs.create_release != 'false' }} if: ${{ github.event.inputs.create_release != 'false' }}
id: create_release # ← this is required id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -96,6 +113,46 @@ jobs:
release_name: Release ${{ steps.semver.outputs.next }} release_name: Release ${{ steps.semver.outputs.next }}
draft: false draft: false
prerelease: false prerelease: false
- name: Create placeholder appsettings for release
if: ${{ github.event.inputs.create_release != 'false' }}
run: |
$appSettings = @{
Logging = @{
LogLevel = @{
Default = "Information"
"Microsoft.AspNetCore" = "Warning"
}
}
ApiConfiguration = @{
EspConfiguration = @{
InformationBoardImageUrl = "http://server_ip:port/home/default.jpg"
UpdateIntervalMinutes = [int]"${{ vars.ESP_UPDATE_INTERVAL }}"
BlackTextThreshold = [int]"${{ vars.ESP_BLACK_TEXT_THRESHOLD }}"
EnableDithering = [System.Convert]::ToBoolean("${{ vars.ESP_ENABLE_DITHERING }}")
DitheringStrength = [int]"${{ vars.ESP_DITHERING_STRENGTH }}"
EnhanceContrast = [System.Convert]::ToBoolean("${{ vars.ESP_ENHANCE_CONTRAST }}")
ContrastStrength = [int]"${{ vars.ESP_CONTRAST_STRENGTH }}"
IsHighContrastMode = [System.Convert]::ToBoolean("${{ vars.ESP_HIGH_CONTRAST_MODE }}")
}
Keys = @{
Weather = "SET THIS TO YOUR KEY"
ResRobot = "SET THIS TO YOUR KEY"
}
BaseUrls = @{
Nominatim = "${{ vars.NOMINATIM_URL }}"
Aurora = "${{ vars.AURORA_URL }}"
Weather = "${{ vars.WEATHER_URL }}"
ResRobot = "${{ vars.RES_ROBOT_URL }}"
}
DefaultCity = "CITY ADDRESS"
DefaultStation = "YOUR STATION"
}
AllowedHosts = "*"
}
$appSettings | ConvertTo-Json -Depth 10 | Set-Content -Path "./output/dotnet/appsettings.json"
Write-Host "Created placeholder appsettings.json successfully"
- name: Zip the build for github release - name: Zip the build for github release
if: ${{ github.event.inputs.create_release != 'false' }} if: ${{ github.event.inputs.create_release != 'false' }}
@@ -107,7 +164,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # ← now available upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/HomeScreen_Build_${{ steps.semver.outputs.next }}.zip asset_path: ./output/HomeScreen_Build_${{ steps.semver.outputs.next }}.zip
asset_name: HomeScreen_Build_${{ steps.semver.outputs.next }}.zip asset_name: HomeScreen_Build_${{ steps.semver.outputs.next }}.zip
asset_content_type: application/zip asset_content_type: application/zip
@@ -151,24 +208,6 @@ jobs:
$appSettings | ConvertTo-Json -Depth 10 | Set-Content -Path "./output/dotnet/appsettings.json" $appSettings | ConvertTo-Json -Depth 10 | Set-Content -Path "./output/dotnet/appsettings.json"
Write-Host "Generated appsettings.json successfully" Write-Host "Generated appsettings.json successfully"
# Check wwwroot and manually copy if missing
- name: Ensure wwwroot is Included
run: |
if (-not (Test-Path -Path "./output/dotnet/wwwroot")) {
Write-Host "wwwroot folder not found in published output, manually copying..."
# Check if wwwroot exists in project directory
$sourceWwwroot = "./HomeApi/wwwroot"
if (Test-Path -Path $sourceWwwroot) {
Write-Host "Found wwwroot directory in source, copying..."
New-Item -ItemType Directory -Path "./output/dotnet/wwwroot" -Force
Copy-Item -Path "$sourceWwwroot/*" -Destination "./output/dotnet/wwwroot" -Recurse -Force
} else {
Write-Host "WARNING: Could not find wwwroot in source directory!"
}
}
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -176,7 +215,7 @@ jobs:
path: ./output/dotnet path: ./output/dotnet
deploy: deploy:
runs-on: self-hosted # Ensure your self-hosted runner is configured runs-on: self-hosted
needs: build needs: build
environment: ${{ github.event.inputs.environment || 'prod' }} environment: ${{ github.event.inputs.environment || 'prod' }}

View File

@@ -1,10 +1,10 @@
[![myxelium - homescreen](https://img.shields.io/static/v1?label=myxelium&message=homescreen&color=purple&logo=github)](https://github.com/myxelium/homescreen "Go to GitHub repo") [![myxelium - Wireless_Eink_HomeScreen](https://img.shields.io/static/v1?label=myxelium&message=Wireless_Eink_HomeScreen&color=purple&logo=github)](https://github.com/myxelium/Wireless_Eink_HomeScreen "Go to GitHub repo")
[![stars - homescreen](https://img.shields.io/github/stars/myxelium/homescreen?style=social)](https://github.com/myxelium/homescreen) [![stars - Wireless_Eink_HomeScreen](https://img.shields.io/github/stars/myxelium/Wireless_Eink_HomeScreen?style=social)](https://github.com/myxelium/Wireless_Eink_HomeScreen)
[![forks - homescreen](https://img.shields.io/github/forks/myxelium/homescreen?style=social)](https://github.com/myxelium/homescreen) [![forks - Wireless_Eink_HomeScreen](https://img.shields.io/github/forks/myxelium/Wireless_Eink_HomeScreen?style=social)](https://github.com/myxelium/Wireless_Eink_HomeScreen)
[![GitHub tag](https://img.shields.io/github/tag/myxelium/homescreen?include_prereleases=&sort=semver&color=purple)](https://github.com/myxelium/homescreen/releases/) [![GitHub tag](https://img.shields.io/github/tag/myxelium/Wireless_Eink_HomeScreen?include_prereleases=&sort=semver&color=purple)](https://github.com/myxelium/Wireless_Eink_HomeScreen/releases/)
[![License](https://img.shields.io/badge/License-GPL-purple)](https://www.gnu.org/licenses/gpl-3.0.en.html) [![License](https://img.shields.io/badge/License-GPL-purple)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![issues - homescreen](https://img.shields.io/github/issues/myxelium/homescreen)](https://github.com/myxelium/homescreen/issues) [![issues - Wireless_Eink_HomeScreen](https://img.shields.io/github/issues/myxelium/Wireless_Eink_HomeScreen)](https://github.com/myxelium/Wireless_Eink_HomeScreen/issues)
[![Build and Deploy](https://github.com/Myxelium/HomeScreen/actions/workflows/build.yml/badge.svg)](https://github.com/Myxelium/HomeScreen/actions/workflows/build.yml) [![Build and Deploy](https://github.com/Myxelium/Wireless_Eink_HomeScreen/actions/workflows/build.yml/badge.svg)](https://github.com/Myxelium/Wireless_Eink_HomeScreen/actions/workflows/build.yml)
# What why how # What why how
This is a project I created that pulls weather data from the internet, transforms it into custom images, and displays them on an e-ink screen powered by an ESP32. This is a project I created that pulls weather data from the internet, transforms it into custom images, and displays them on an e-ink screen powered by an ESP32.