docfast/scripts/setup-secrets.sh
openclawd 7d3525fe57 Add CI/CD deployment pipeline with Forgejo Actions
- Add .forgejo/workflows/deploy.yml for automated deployment
- Include rollback mechanism with image tagging
- Add health check verification (http://127.0.0.1:3100/health)
- Create manual rollback script for emergency use
- Add deployment documentation and setup instructions
- Supports auto-rollback on deployment failure
2026-02-15 11:02:43 +00:00

41 lines
No EOL
1.2 KiB
Bash
Executable file

#!/bin/bash
echo "🔐 Forgejo Repository Secrets Setup"
echo "===================================="
# Source credentials to get Forgejo token
source /home/openclaw/.openclaw/workspace/.credentials/docfast.env
# Repository secrets to set up
REPO_URL="https://git.cloonar.com/api/v1/repos/openclawd/docfast/actions/secrets"
echo "Setting up repository secrets for CI/CD..."
# Server host
echo "📡 Setting SERVER_HOST..."
curl -X PUT "$REPO_URL/SERVER_HOST" \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":"167.235.156.214"}' \
--silent
# Server user
echo "👤 Setting SERVER_USER..."
curl -X PUT "$REPO_URL/SERVER_USER" \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":"root"}' \
--silent
# SSH Private Key
echo "🔑 Setting SSH_PRIVATE_KEY..."
SSH_KEY_CONTENT=$(cat /home/openclaw/.ssh/docfast | jq -Rs .)
curl -X PUT "$REPO_URL/SSH_PRIVATE_KEY" \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"data\":$SSH_KEY_CONTENT}" \
--silent
echo "✅ Repository secrets have been configured!"
echo ""
echo "🔍 To verify, check: https://git.cloonar.com/openclawd/docfast/settings/actions/secrets"