changes
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s

This commit is contained in:
geezo 2025-05-07 01:45:09 +00:00
parent 24d8cd1344
commit 39c9b7a048
3 changed files with 27 additions and 3 deletions

View File

@ -13,7 +13,6 @@ jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Execute remote SSH commands using password
uses: appleboy/ssh-action@v1
with:
@ -22,5 +21,5 @@ jobs:
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd /home/geezo/docker_containers/${{ env.app_folder }} && \
docker compose -f docker-compose.yml down \
cd /home/geezo/docker_containers && \
./restart_container.sh ${{ env.app_folder }} \

View File

@ -1,2 +1,3 @@
sdvsdvccsddddcacssdcws
sdcsdccdwc
scwdc

24
restart_container.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Check if a value was provided
if [ -z "$1" ]; then
echo "Usage: $0 <value>"
exit 1
fi
# Use the provided argument
VALUE="$1"
TARGET_DIR="/home/geezo/docker_containers/$VALUE"
# Check if the directory exists
if [ ! -d "$TARGET_DIR" ]; then
echo "Error: Directory $TARGET_DIR does not exist."
exit 1
fi
# Navigate to the target directory
cd "$TARGET_DIR" || { echo "Failed to change directory to $TARGET_DIR"; exit 1; }
# Run Docker Compose commands
docker compose down
docker compose up -d