Skip to content
Closed

Dev #262

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/trigger-dev-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Trigger Development Deployment

on:
push:
branches: [dev]
workflow_dispatch:

jobs:
trigger-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Trigger deployment in bitmaker-cloud-deploy
run: |
echo "🚀 Triggering deployment for commit: ${{ github.sha }}"
echo "Branch: ${{ github.ref_name }}"
echo "Triggered by: ${{ github.actor }}"

# Escape commit message for JSON
COMMIT_MSG=$(echo "${{ github.event.head_commit.message }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')

response=$(curl -X POST \
-H "Authorization: token ${{ secrets.DEPLOY_TRIGGER_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/json" \
"${{ secrets.DEPLOY_WEBHOOK_URL }}" \
-d "{
\"event_type\": \"deploy-dev-auto\",
\"client_payload\": {
\"source_repo\": \"estela\",
\"branch\": \"${{ github.ref_name }}\",
\"commit\": \"${{ github.sha }}\",
\"triggered_by\": \"${{ github.actor }}\",
\"commit_message\": \"${COMMIT_MSG}\"
}
}" \
-w "\n%{http_code}" \
-s)

http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')

if [ "$http_code" = "204" ]; then
echo "✅ Deployment triggered successfully!"
else
echo "❌ Failed to trigger deployment"
echo "HTTP Status: $http_code"
echo "Response: $body"
exit 1
fi

- name: Add deployment status comment
if: github.event_name == 'push'
uses: actions/github-script@v6
with:
script: |
const commit_sha = context.sha;
const message = `🚀 Deployment to development environment has been triggered!\n\nCommit: ${commit_sha.substring(0, 7)}`;

// Create a commit comment
await github.rest.repos.createCommitComment({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: commit_sha,
body: message
});
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- When deploy to kubernetes please check that we're using the do-nyc1-scraping-development-cluster cluster and if not please request a confirmation
- Use amd64 docker buildings for default
- Use aws-vault with creds estela_api_creds to run aws commands
Loading