Skip to content

Commit

Permalink
deploy to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vnau committed Nov 14, 2024
1 parent c3fed75 commit 5ead4fe
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to GitHub Pages

on:
push:
branches: 'main'

jobs:
build_site:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm install

- name: build
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: |
npm run build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: 'frontend/dist/'

deploy:
needs: build_site
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
const apiUrl =
host == "localhost" || host == "127.0.0.1"
? "http://fritzgate/api/"
: "/api/";
: host == "vnau.github.io"
? "/FritzGate/api/"
: "/api/";
//const apiUrl = "/api/";
let data: StatusData;
let busy = false;
Expand Down
163 changes: 163 additions & 0 deletions frontend/src/public/api/status
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"sensors": [
{
"name": "Govee H5075 01CB",
"id": "GVH5075_01CB",
"model": "H5075",
"serial": "01CB",
"battery": 100,
"rssi": -94,
"humidity": 43.4,
"temperature": 22.1,
"temperatureAvg": 22.3,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600
},
{
"name": "ThermoPro TP35X/393 B1AB",
"id": "GVH5075_B1AB",
"model": "H5075",
"serial": "B1AB",
"battery": 100,
"rssi": -84,
"humidity": 47.6,
"temperature": 21.8,
"temperatureAvg": 21.8,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600
},
{
"name": "SwitchBot THX1/W230150X 34EF",
"id": "GVH5075_34EF",
"model": "H5075",
"serial": "34EF",
"battery": 100,
"rssi": -64,
"humidity": 45.1,
"temperature": 22.4,
"temperatureAvg": 22.4,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600
},
{
"name": "Govee H5100 4683",
"id": "GVH5075_4683",
"model": "H5075",
"serial": "4683",
"battery": 100,
"rssi": -78,
"humidity": 51.4,
"temperature": 21.7,
"temperatureAvg": 21.8,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600
}
],
"thermostats": [
{
"name": "Kitchen",
"id": "16",
"model": "FRITZ!DECT 301",
"serial": "23515 0707001",
"battery": 10,
"rssi": 0,
"humidity": 0,
"temperature": 23.5,
"temperatureAvg": 0,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600,
"externalTemperatureSensorId": "tochoose",
"temperatureSensor": "own",
"offset": 1,
"offsetTimestamp": 0,
"targetTemperature": 22,
"targetTemperatureHigh": 22,
"targetTemperatureLow": 19,
"referenceSensor": "GVH5075_4683"
},
{
"name": "Living room",
"id": "17",
"model": "FRITZ!DECT 301",
"serial": "23515 0707002",
"battery": 30,
"rssi": 0,
"humidity": 0,
"temperature": 23.5,
"temperatureAvg": 0,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600,
"externalTemperatureSensorId": "tochoose",
"temperatureSensor": "own",
"offset": 0,
"offsetTimestamp": 0,
"targetTemperature": 22,
"targetTemperatureHigh": 22,
"targetTemperatureLow": 19,
"referenceSensor": "GVH5075_34EF"
},
{
"name": "Bedroom",
"id": "18",
"model": "FRITZ!DECT 301",
"serial": "23515 0707003",
"battery": 50,
"rssi": 0,
"humidity": 0,
"temperature": 23,
"temperatureAvg": 0,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600,
"externalTemperatureSensorId": "tochoose",
"temperatureSensor": "own",
"offset": -2.5,
"offsetTimestamp": 1704063600,
"targetTemperature": 22,
"targetTemperatureHigh": 22,
"targetTemperatureLow": 19,
"referenceSensor": "GVH5075_01CB"
},
{
"name": "Child's room",
"id": "19",
"model": "FRITZ!DECT 301",
"serial": "23515 0707004",
"battery": 70,
"rssi": 0,
"humidity": 0,
"temperature": 22,
"temperatureAvg": 0,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600,
"externalTemperatureSensorId": "tochoose",
"temperatureSensor": "own",
"offset": -2.5,
"offsetTimestamp": 1704063600,
"targetTemperature": 22,
"targetTemperatureHigh": 22,
"targetTemperatureLow": 19,
"referenceSensor": "GVH5075_B1AB"
},
{
"name": "Bathroom",
"id": "20",
"model": "FRITZ!DECT 301",
"serial": "23515 0707005",
"battery": 90,
"rssi": 0,
"humidity": 0,
"temperature": 20.5,
"temperatureAvg": 0,
"seriesTimestamp": 1704063600,
"timestamp": 1704063600,
"externalTemperatureSensorId": "tochoose",
"temperatureSensor": "own",
"offset": 0,
"offsetTimestamp": 0,
"targetTemperature": 22,
"targetTemperatureHigh": 22,
"targetTemperatureLow": 19,
"referenceSensor": ""
}
]
}

0 comments on commit 5ead4fe

Please sign in to comment.