Skip to content

Commit

Permalink
quickfix: fix deploy script and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SwanX1 committed Aug 28, 2024
1 parent 9f32f02 commit d9371af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down

0 comments on commit d9371af

Please sign in to comment.