fix: Add git checkout main to deployment scripts
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Update deploy-production.sh to properly checkout main branch
- Fix PRODUCTION_INSTALLATION.md to include checkout main step
- Ensure all deployment instructions switch to main branch correctly
This commit is contained in:
2025-10-06 22:46:07 +00:00
parent 4e19b992df
commit 36f3f83896
2 changed files with 291 additions and 3 deletions

View File

@@ -101,13 +101,15 @@ log "${CYAN}Step 5: Fetching latest code from main branch...${NC}"
if [ -d "$DEPLOY_DIR" ]; then
warning "Deployment directory exists, pulling latest changes..."
cd "$DEPLOY_DIR"
git fetch origin main
git reset --hard origin/main
git fetch origin
git checkout main
git pull origin main --ff-only
git clean -fd
else
log "Cloning repository..."
git clone -b main "$REPO_URL" "$DEPLOY_DIR"
git clone "$REPO_URL" "$DEPLOY_DIR"
cd "$DEPLOY_DIR"
git checkout main
fi
success "Repository updated to latest main branch"