diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index 2d7d662fbe..a992de3a2f 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -44,14 +44,19 @@ jobs: run: | BRANCH=${{ github.ref_name }} THEME=${BRANCH:6} - mv "dist_$THEME" ${{ github.ref_name }} - zip ${{ github.ref_name }}.zip -r ${{ github.ref_name }}/* + zip dist_$THEME.zip -r dist_$THEME/* - name: uploading file - run: scp ${{ github.ref_name }}.zip hetzner:/root/staging/ + run: | + BRANCH=${{ github.ref_name }} + THEME=${BRANCH:6} + scp dist_$THEME.zip hetzner:/root/staging/dist_$THEME.zip - name: unzipping remote file - run: ssh hetzner "cd /root/staging && unzip ${{ github.ref_name }}.zip && rm -rf /root/single_theme_builds/${{ github.ref_name }} && mv /root/staging/${{ github.ref_name }}/ /root/single_theme_builds/ && rm ${{ github.ref_name }}.zip" + run: | + BRANCH=${{ github.ref_name }} + THEME=${BRANCH:6} + ssh hetzner "cd /root/staging && unzip dist_$THEME.zip && rm -rf /root/single_theme_builds/$THEME && mkdir -p /root/single_theme_builds/$THEME && mv /root/staging/dist_$THEME/* /root/single_theme_builds/$THEME/ && rm dist_$THEME.zip && rmdir dist_$THEME/" diff --git a/package.json b/package.json index 23153a9068..9a173b4f8b 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "strt": "vite --host | sed 's/localhost:/127.0.0.1:/g'", "build": "./scripts/build.sh", "build:single": "./scripts/single_build.sh", + "build:vite:single": "vite build --sourcemap --config vite_single.config.js", "build:dbscript": "vite-node ./scripts/osm2pgsql/generateBuildDbScript.ts", "prepare-deploy": "npm run generate:service-worker && ./scripts/prepare-build.sh && npm run build", "watch:css": "tailwindcss -i src/index.css -o public/css/index-tailwind-output.css --watch", diff --git a/scripts/single_build.sh b/scripts/single_build.sh index ab10c56189..3bce06c682 100755 --- a/scripts/single_build.sh +++ b/scripts/single_build.sh @@ -44,7 +44,7 @@ sed -i "s/\/\/ LAYOUT.ADD_CONFIG/layout.enableMoreQuests = false/" index_"$THEME export NODE_OPTIONS=--max-old-space-size=20000 -vite build --sourcemap --config vite_single.config.js || { echo 'Vite build failed' ; exit 1; } +npm run build:vite:single || { echo 'Vite build failed' ; exit 1; } cp -r assets/layers/ dist/assets/layers/ @@ -96,9 +96,4 @@ then fi npm run clean -echo "BUILD COMPLETED" -echo "On what domain will you deploy?" -echo " ! Don't forget to add `https://yourdomain.tld/land.html` to the Redirect URIs on https://www.openstreetmap.org/oauth2/applications/" -echo "Deploying on github pages?" -echo " 1. Don't forget to add a CNAME file (containing your domain name verbatim, without protocol)" -echo " 2 .nojekyll file (which is empty)" +echo "BUILD COMPLETED. Files are in dist_$1"