From d9371afa42e1bf6eb84ebc4a4a9a21ee71f5264e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20=C4=8Cer=C5=86avskis?= Date: Wed, 28 Aug 2024 23:38:11 +0300 Subject: [PATCH] quickfix: fix deploy script and workflow --- .github/workflows/ci.yml | 1 + deploy.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b053db3..cef3b77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,3 +244,4 @@ jobs: if: success() && github.event_name == 'push' && github.ref == 'refs/heads/stable' needs: [build, format, lint] uses: ./.github/workflows/deploy.yml + secrets: inherit diff --git a/deploy.sh b/deploy.sh index c45be7f..6f8659c 100644 --- a/deploy.sh +++ b/deploy.sh @@ -6,6 +6,7 @@ SERVICE_NAME="webapp" SERVICE_USER="github" GIT_REMOTE="https://github.com/infernalstudios.org.git" +GIT_BRANCH="stable" # Check if the script is run as root if [ "$(id -u)" -eq 0 ]; then @@ -25,13 +26,15 @@ if [ -z $(command -v screen) ]; then exit 1 fi +echo "Running as $(whoami) in $(pwd)." + # Find service path -if [ ! -f "~/.service_paths" ]; then +if [ ! -f "$(pwd)/.service_paths" ]; then echo "Did you initialize the service using server-init.sh?: .service_paths not found." exit 1 fi -SERVICE_PATH=$(cat ~/.service_paths | grep $SERVICE_NAME | cut -d' ' -f2) +SERVICE_PATH=$(cat $(pwd)/.service_paths | grep $SERVICE_NAME | cut -d' ' -f2) if [ -z "$SERVICE_PATH" ]; then echo "Did you initialize the service using server-init.sh?: Service path not found in .service_paths."