File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ security :
11+ name : Security Scan
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - uses : ruby/setup-ruby@v1
18+ with :
19+ ruby-version : .ruby-version
20+ bundler-cache : true
21+
22+ - name : Brakeman
23+ run : bundle exec brakeman -q -w2 --no-pager
24+
25+ - name : Bundle Audit
26+ run : |
27+ gem install bundler-audit --no-document
28+ bundle-audit check --update
29+
30+ lint :
31+ name : RuboCop
32+ runs-on : ubuntu-latest
33+
34+ steps :
35+ - uses : actions/checkout@v4
36+
37+ - uses : ruby/setup-ruby@v1
38+ with :
39+ ruby-version : .ruby-version
40+ bundler-cache : true
41+
42+ - name : RuboCop
43+ run : bundle exec rubocop --parallel --format simple
Original file line number Diff line number Diff line change 1+ name : Deploy to Production
2+
3+ on :
4+ push :
5+ branches : [main]
6+ workflow_dispatch :
7+
8+ jobs :
9+ deploy :
10+ name : Trigger Coolify Deploy
11+ runs-on : ubuntu-latest
12+
13+ environment :
14+ name : production
15+ url : https://kingslendas.com
16+
17+ steps :
18+ - name : Trigger Coolify webhook
19+ run : |
20+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
21+ -X GET "${{ secrets.COOLIFY_WEBHOOK_URL }}")
22+
23+ if [ "$HTTP_STATUS" -ge 200 ] && [ "$HTTP_STATUS" -lt 300 ]; then
24+ echo "Deploy triggered successfully (HTTP $HTTP_STATUS)"
25+ else
26+ echo "Failed to trigger deploy (HTTP $HTTP_STATUS)"
27+ exit 1
28+ fi
29+
30+ - name : Wait for deploy and health check
31+ run : |
32+ echo "Waiting 60s for Coolify to build and start..."
33+ sleep 60
34+
35+ for i in {1..10}; do
36+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://kingslendas.com/up)
37+ if [ "$HTTP_STATUS" -eq 200 ]; then
38+ echo "Health check passed (attempt $i)"
39+ exit 0
40+ fi
41+ echo "Attempt $i/10 — HTTP $HTTP_STATUS, retrying in 15s..."
42+ sleep 15
43+ done
44+
45+ echo "Health check failed after all attempts"
46+ exit 1
You can’t perform that action at this time.
0 commit comments