From 7aafa47fb3bdd9d3566f2cd5410ee95f25a81524 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 16:49:56 +0100 Subject: [PATCH 1/4] Actions: attempt to fix build --- package.json | 1 + scripts/single_build.sh | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) 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" From 7117b29776e61309998996856be5a779c8b4cc7d Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 17:29:31 +0100 Subject: [PATCH 2/4] Actions: Attempt to fix build --- .forgejo/workflows/deploy_single_theme.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index 2d7d662fbe..e145f44f29 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -44,14 +44,18 @@ 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 - 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/" From cc75bf70b125d48670521e5071aae62ed3fcead4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 18:01:06 +0100 Subject: [PATCH 3/4] Actions: Attempt to fix build --- .forgejo/workflows/deploy_single_theme.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index e145f44f29..c9fb9b57e3 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -55,7 +55,8 @@ jobs: - name: unzipping remote file 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/" + 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/" From e43270a8f7368cddbf41d5571f615de10920329a Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 18:52:40 +0100 Subject: [PATCH 4/4] Actions: attempt to fix build --- .forgejo/workflows/deploy_single_theme.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy_single_theme.yml b/.forgejo/workflows/deploy_single_theme.yml index c9fb9b57e3..a992de3a2f 100644 --- a/.forgejo/workflows/deploy_single_theme.yml +++ b/.forgejo/workflows/deploy_single_theme.yml @@ -50,13 +50,13 @@ jobs: run: | BRANCH=${{ github.ref_name }} THEME=${BRANCH:6} - scp dist_$THEME.zip hetzner:/root/staging/dist_$THEME + scp dist_$THEME.zip hetzner:/root/staging/dist_$THEME.zip - name: unzipping remote file 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/" + 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/"