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
This commit is contained in:
parent
0453176544
commit
7d3525fe57
4 changed files with 290 additions and 0 deletions
41
scripts/setup-secrets.sh
Executable file
41
scripts/setup-secrets.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue