diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 6209ed2..dbdc33c 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -19,7 +19,8 @@ jobs: with: node-version: 16.x - run: cd js && npm install && npm run build - - run: cd app && npm install && npm run build + - run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env + - run: cd app && npm install && ./node_modules/.bin/tsc && ./node_modules/.bin/vite build --base=/PMTiles/ - name: build_app uses: peaceiris/actions-gh-pages@v3 if: ${{ github.ref == 'refs/heads/master' }} diff --git a/app/.gitignore b/app/.gitignore index a547bf3..7ceb59f 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -22,3 +22,4 @@ dist-ssr *.njsproj *.sln *.sw? +.env diff --git a/app/package.json b/app/package.json index 93eeeb7..50fd3d1 100644 --- a/app/package.json +++ b/app/package.json @@ -4,7 +4,6 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "tsc && vite build", "preview": "vite preview" }, "dependencies": { diff --git a/app/src/App.tsx b/app/src/App.tsx index 9162235..87f6fc3 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -10,6 +10,8 @@ const Header = styled("div", { height: "$4", }); +const GIT_SHA = import.meta.env.VITE_GIT_SHA.substr(0,8) + function App() { globalStyles(); @@ -27,7 +29,7 @@ function App() { return (