Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Debug environment
run: |
echo "PUBLIC_URL will be set to: /hush"
echo "Homepage from package.json:"
cat package.json | grep homepage

- name: Build
run: npm run build
env:
PUBLIC_URL: /hush
REACT_APP_PUBLIC_URL: /hush

- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ function App() {
if (!isRaining) {
// Start rain
if (!audioRef.current) {
const audioPath = `${process.env.PUBLIC_URL}/audio/531947__straget__the-rain-falls-against-the-parasol.wav`;
// Fallback approach for PUBLIC_URL
const publicUrl = process.env.PUBLIC_URL || (window.location.pathname !== '/' ? window.location.pathname.replace(/\/$/, '') : '');
const audioPath = `${publicUrl}/audio/531947__straget__the-rain-falls-against-the-parasol.wav`;
console.log('Audio path:', audioPath); // Debug log
audioRef.current = new Audio(audioPath);
audioRef.current.loop = true;
}
Expand Down
Loading