remove ass
This commit is contained in:
@@ -36,8 +36,6 @@ jobs:
|
||||
VITE_HA_TOKEN: ${{ secrets.VITE_HA_TOKEN }}
|
||||
- name: Build
|
||||
run: bun run build
|
||||
- name: Write Git-Hash into html
|
||||
run: ./pipeline/create-git-hash-html.sh
|
||||
- name: Create Build Artifact
|
||||
uses: christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "$GITHUB_SHA" > dist/git-hash.html
|
||||
@@ -16,28 +16,6 @@ import Weather from "@/components/Weather/Weather";
|
||||
import style from "./style.module.css";
|
||||
|
||||
export default function Dashboard() {
|
||||
// '/git-hash.html' contains the current git commit hash, check it every 10 seconds and reload if it isn't the same
|
||||
const [gitHash, setGitHash] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(async () => {
|
||||
const response = await fetch("/git-hash.html");
|
||||
const text = await response.text();
|
||||
const newHash = text.trim();
|
||||
console.log("Fetched git hash:", newHash);
|
||||
|
||||
if (gitHash === "") {
|
||||
setGitHash(newHash);
|
||||
}
|
||||
|
||||
if (gitHash !== "" && newHash !== gitHash) {
|
||||
setGitHash(newHash);
|
||||
window.location.reload();
|
||||
}
|
||||
}, 10000);
|
||||
return () => clearInterval(interval);
|
||||
}, [gitHash]);
|
||||
|
||||
const schemes = [style.day, style.evening, style.night];
|
||||
const [schemeIndex, setSchemeIndex] = useState(0);
|
||||
const scheme = schemes[schemeIndex];
|
||||
|
||||
Reference in New Issue
Block a user