Refactor deployment scripts to use git fetch and reset for pulling latest changes. Update deploy-production.sh and deploy-test.sh to ensure a clean state before deployment. Modify code-analysis.yml to reflect these changes in deployment commands.
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 2m58s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m0s

This commit is contained in:
Torsten Schulz (local)
2026-04-16 13:11:23 +02:00
parent 4d5fb43ebc
commit 18da725567
3 changed files with 7 additions and 5 deletions

View File

@@ -118,7 +118,7 @@ jobs:
-o BatchMode=yes \ -o BatchMode=yes \
-p "${{ vars.PROD_PORT }}" \ -p "${{ vars.PROD_PORT }}" \
"${{ vars.PROD_USER }}@${{ vars.PROD_HOST }}" \ "${{ vars.PROD_USER }}@${{ vars.PROD_HOST }}" \
"bash -lc 'cd /var/www/harheimertc && ./deploy-production.sh'" "bash -lc 'cd /var/www/harheimertc && git fetch origin main && git checkout -B main origin/main && git reset --hard origin/main && ./deploy-production.sh'"
deploy-test: deploy-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -149,4 +149,4 @@ jobs:
-o BatchMode=yes \ -o BatchMode=yes \
-p "${{ vars.PROD_PORT }}" \ -p "${{ vars.PROD_PORT }}" \
"${{ vars.PROD_USER }}@${{ vars.PROD_HOST }}" \ "${{ vars.PROD_USER }}@${{ vars.PROD_HOST }}" \
"bash -lc 'cd /var/www/harheimertc.test && ./deploy-test.sh'" "bash -lc 'cd /var/www/harheimertc.test && git fetch origin dev && git checkout -B dev origin/dev && git reset --hard origin/dev && ./deploy-test.sh'"

View File

@@ -208,7 +208,9 @@ git clean -fd \
# Pull latest changes # Pull latest changes
echo " Pulling latest changes..." echo " Pulling latest changes..."
if ! git pull --ff-only; then git fetch origin main
git checkout -B main origin/main
if ! git reset --hard origin/main; then
echo "ERROR: git pull fehlgeschlagen." echo "ERROR: git pull fehlgeschlagen."
echo "" echo ""
echo "Häufige Ursache: SSH-Key für den aktuellen User fehlt." echo "Häufige Ursache: SSH-Key für den aktuellen User fehlt."

View File

@@ -215,8 +215,8 @@ git clean -fd \
# Pull latest changes # Pull latest changes
echo " Pulling latest changes..." echo " Pulling latest changes..."
git fetch origin dev git fetch origin dev
git checkout dev git checkout -B dev origin/dev
if ! git pull --ff-only origin dev; then if ! git reset --hard origin/dev; then
echo "ERROR: git pull fehlgeschlagen." echo "ERROR: git pull fehlgeschlagen."
echo "" echo ""
echo "Häufige Ursache: SSH-Key für den aktuellen User fehlt." echo "Häufige Ursache: SSH-Key für den aktuellen User fehlt."