diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 09535d94b9..0b5a2a2fb4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,7 @@ on: branches: - "master" - "hotfix/**" + - "feature/test_desktop" jobs: binary: diff --git a/scripts/build-front.sh b/scripts/build-front.sh index fce9cb7e0a..69922a04cf 100755 --- a/scripts/build-front.sh +++ b/scripts/build-front.sh @@ -5,7 +5,27 @@ set -e CURR_DIR=$(cd "$(dirname "$0")" && pwd) cd "$CURR_DIR"/../webapp + +# shellcheck disable=SC2016 +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's|"homepage".*|"homepage": "/static",|g' package.json + sed -i '' 's|loadPath.*|loadPath: `/static/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +else + sed -i 's|"homepage".*|"homepage": "/static",|g' package.json + sed -i 's|loadPath.*|loadPath: `/static/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +fi + npm run build + +# shellcheck disable=SC2016 +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's|"homepage".*|"homepage": "/",|g' package.json + sed -i '' 's|loadPath.*|loadPath: `/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +else + sed -i 's|"homepage".*|"homepage": "/",|g' package.json + sed -i 's|loadPath.*|loadPath: `/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +fi + cd .. rm -fr resources/webapp cp -r ./webapp/dist/ resources/webapp diff --git a/webapp/package.json b/webapp/package.json index c4ec8e33c1..661d1fc2f1 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -2,9 +2,10 @@ "name": "antares-web", "version": "2.16.3", "private": true, + "homepage": "/", "type": "module", "scripts": { - "build": "tsc && vite build", + "build": "tsc && vite build --base=./", "clean": "rm -rf dist node_modules/.vite", "dev": "vite", "lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives",