From f92ee0a2484c857f4b5fd66c689b0dac5e871437 Mon Sep 17 00:00:00 2001 From: Yotam Ashman Date: Tue, 7 Apr 2026 23:41:19 +0300 Subject: [PATCH 1/2] Add vercel deoployment setup --- .github/workflows/deploy-graphos.yml | 116 --------------------------- build.sh | 26 ++++++ vercel.json | 7 ++ 3 files changed, 33 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/deploy-graphos.yml create mode 100755 build.sh create mode 100644 vercel.json diff --git a/.github/workflows/deploy-graphos.yml b/.github/workflows/deploy-graphos.yml deleted file mode 100644 index 6616dfa..0000000 --- a/.github/workflows/deploy-graphos.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Deploy Godot Web to Home Server - -on: - push: - branches: - - main - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - env: - GODOT_VERSION_TAG: "4.5-stable" # GitHub release tag - GODOT_TEMPLATES_DIR: "4.5.stable" # Directory name Godot uses - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Download Godot editor - run: | - URL_EDITOR="https://github.com/godotengine/godot/releases/download/${GODOT_VERSION_TAG}/Godot_v${GODOT_VERSION_TAG}_linux.x86_64.zip" - echo "Downloading Godot editor from: $URL_EDITOR" - - curl -L \ - --retry 5 \ - --retry-delay 10 \ - --retry-all-errors \ - -o godot.zip \ - "$URL_EDITOR" - - unzip godot.zip - mv Godot_v${GODOT_VERSION_TAG}_linux.x86_64 godot - chmod +x godot - - - name: Download Godot export templates - run: | - TEMPL_DIR="${HOME}/.local/share/godot/export_templates/${GODOT_TEMPLATES_DIR}" - mkdir -p "$TEMPL_DIR" - - URL_TEMPLATES="https://github.com/godotengine/godot/releases/download/${GODOT_VERSION_TAG}/Godot_v${GODOT_VERSION_TAG}_export_templates.tpz" - echo "Downloading Godot export templates from: $URL_TEMPLATES" - - curl -L \ - --retry 5 \ - --retry-delay 10 \ - --retry-all-errors \ - -o templates.tpz \ - "$URL_TEMPLATES" - - unzip templates.tpz -d "$TEMPL_DIR" - - echo "==== export_templates tree BEFORE fix ====" - ls -R "$TEMPL_DIR" || true - - cd "$TEMPL_DIR" - - # Try to locate any web *debug* and *release* templates in the tree - DEBUG_SRC="$(find . -maxdepth 3 -type f -name 'web*debug*.zip' | head -n 1 || true)" - RELEASE_SRC="$(find . -maxdepth 3 -type f -name 'web*release*.zip' | head -n 1 || true)" - - echo "Found DEBUG_SRC=$DEBUG_SRC" - echo "Found RELEASE_SRC=$RELEASE_SRC" - - if [ -z "$DEBUG_SRC" ] || [ -z "$RELEASE_SRC" ]; then - echo "ERROR: Could not find web debug/release templates inside templates.tpz" - exit 1 - fi - - # Copy to exactly the names Godot 4.3 expects: - cp "$DEBUG_SRC" "$TEMPL_DIR/web_nothreads_debug.zip" - cp "$RELEASE_SRC" "$TEMPL_DIR/web_nothreads_release.zip" - - echo "==== export_templates tree AFTER fix ====" - ls -R "$TEMPL_DIR" - - - name: Export Web - run: | - # Ensure export directory exists - mkdir -p export - - ./godot --headless --quiet --path . \ - --export-debug "Web" - - - name: Setup SSH - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - ssh-keyscan -H "${{ secrets.DEPLOY_HOST }}" >> ~/.ssh/known_hosts - - - name: Setup SSH and test - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - - ssh-keyscan -H "${{ secrets.DEPLOY_HOST }}" >> ~/.ssh/known_hosts - - echo "Testing SSH connectivity..." - ssh -vvv -i ~/.ssh/id_ed25519 \ - "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ - 'echo "Connected from GitHub Actions"' - - - name: Install rsync locally - if: ${{ env.ACT }} - run: | - apt-get update && apt-get install -y rsync - - - name: Deploy via rsync - run: | - # Adjust if you changed export_path; with your config it’s graphos-export/Graphos.html - rsync -avz --delete \ - --chmod=D755,F644 \ - export/ \ - ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..78dfa5b --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -ex + +GODOT_VERSION="4.6-stable" +BASE_VERSION=$(echo "$GODOT_VERSION" | cut -d'-' -f1) +V_DIR="${BASE_VERSION}.stable" + +mkdir -p ~/.local/share/godot/export_templates/${V_DIR} +mkdir -p public + +echo "Downloading Godot ${GODOT_VERSION}..." +FILE_VERSION="Godot_v${GODOT_VERSION}_linux.x86_64" +wget -q "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/${FILE_VERSION}.zip" -O godot.zip +wget -q "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_export_templates.tpz" -O templates.tpz + +echo "Extracting..." +unzip -q godot.zip +unzip -q templates.tpz + +echo "Installing templates..." +mv templates/* ~/.local/share/godot/export_templates/${V_DIR}/ + +echo "Building project for Web..." +./${FILE_VERSION} --headless --export-release "Web" public/index.html + +echo "Build complete." diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..2aadb2e --- /dev/null +++ b/vercel.json @@ -0,0 +1,7 @@ +{ + "version": 2, + "buildCommand": "bash build.sh", + "outputDirectory": "public", + "framework": null, + "ignoreCommand": "git diff --quiet HEAD^ HEAD ./" +} From 8fb970a52405f650683dc9dcfbd4cb1f2b952e93 Mon Sep 17 00:00:00 2001 From: Yotam Ashman Date: Tue, 7 Apr 2026 23:46:57 +0300 Subject: [PATCH 2/2] Change build script to curl instead of bash --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 78dfa5b..f0e3bcc 100755 --- a/build.sh +++ b/build.sh @@ -10,8 +10,8 @@ mkdir -p public echo "Downloading Godot ${GODOT_VERSION}..." FILE_VERSION="Godot_v${GODOT_VERSION}_linux.x86_64" -wget -q "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/${FILE_VERSION}.zip" -O godot.zip -wget -q "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_export_templates.tpz" -O templates.tpz +curl -L -s "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/${FILE_VERSION}.zip" -o godot.zip +curl -L -s "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_export_templates.tpz" -o templates.tpz echo "Extracting..." unzip -q godot.zip