1+ name : Deployment Status Check
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+ workflow_dispatch :
9+
10+ env :
11+ NODE_VERSION : ' 20'
12+
13+ jobs :
14+ deployment-readiness :
15+ name : Deployment Readiness Check
16+ runs-on : ubuntu-latest
17+
18+ outputs :
19+ ready-for-deployment : ${{ steps.readiness.outputs.ready }}
20+ version : ${{ steps.version-check.outputs.version }}
21+ lint-status : ${{ steps.lint-check.outputs.status }}
22+ test-status : ${{ steps.test-check.outputs.status }}
23+ build-status : ${{ steps.build-check.outputs.status }}
24+
25+ steps :
26+ - name : Checkout code
27+ uses : actions/checkout@v4
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ${{ env.NODE_VERSION }}
33+ cache : ' npm'
34+
35+ - name : Install dependencies
36+ run : npm ci
37+
38+ - name : Check version
39+ id : version-check
40+ run : |
41+ VERSION=$(node -p "require('./package.json').version")
42+ echo "version=$VERSION" >> $GITHUB_OUTPUT
43+ echo "Current version: $VERSION"
44+
45+ if [ "$VERSION" = "1.2.0" ]; then
46+ echo "✅ Version 1.2.0 confirmed"
47+ else
48+ echo "⚠️ Version is $VERSION (expected 1.2.0)"
49+ fi
50+
51+ - name : Lint check
52+ id : lint-check
53+ run : |
54+ if npm run lint; then
55+ echo "status=passed" >> $GITHUB_OUTPUT
56+ echo "✅ Linting passed"
57+ else
58+ echo "status=failed" >> $GITHUB_OUTPUT
59+ echo "❌ Linting failed"
60+ fi
61+
62+ - name : Type check
63+ id : type-check
64+ run : |
65+ if npm run typecheck; then
66+ echo "✅ Type checking passed"
67+ else
68+ echo "❌ Type checking failed"
69+ exit 1
70+ fi
71+
72+ - name : Test check
73+ id : test-check
74+ run : |
75+ if npm test; then
76+ echo "status=passed" >> $GITHUB_OUTPUT
77+ echo "✅ Tests passed"
78+ else
79+ echo "status=failed" >> $GITHUB_OUTPUT
80+ echo "❌ Tests failed"
81+ fi
82+ env :
83+ NODE_OPTIONS : ' --experimental-vm-modules'
84+
85+ - name : Build check
86+ id : build-check
87+ run : |
88+ if npm run build; then
89+ echo "status=passed" >> $GITHUB_OUTPUT
90+ echo "✅ Build successful"
91+ else
92+ echo "status=failed" >> $GITHUB_OUTPUT
93+ echo "❌ Build failed"
94+ exit 1
95+ fi
96+
97+ - name : NPM availability check
98+ run : |
99+ VERSION="${{ steps.version-check.outputs.version }}"
100+ if npm view "@clduab11/gemini-flow@$VERSION" version 2>/dev/null; then
101+ echo "⚠️ Version $VERSION already exists on NPM"
102+ else
103+ echo "✅ Version $VERSION is available for publishing"
104+ fi
105+
106+ - name : Overall readiness assessment
107+ id : readiness
108+ run : |
109+ VERSION="${{ steps.version-check.outputs.version }}"
110+ LINT_STATUS="${{ steps.lint-check.outputs.status }}"
111+ TEST_STATUS="${{ steps.test-check.outputs.status }}"
112+ BUILD_STATUS="${{ steps.build-check.outputs.status }}"
113+
114+ echo "📊 Deployment Readiness Assessment:"
115+ echo "Version: $VERSION"
116+ echo "Lint: $LINT_STATUS"
117+ echo "Tests: $TEST_STATUS"
118+ echo "Build: $BUILD_STATUS"
119+
120+ if [ "$VERSION" = "1.2.0" ] && [ "$LINT_STATUS" = "passed" ] && [ "$TEST_STATUS" = "passed" ] && [ "$BUILD_STATUS" = "passed" ]; then
121+ echo "ready=true" >> $GITHUB_OUTPUT
122+ echo "✅ Ready for deployment!"
123+ else
124+ echo "ready=false" >> $GITHUB_OUTPUT
125+ echo "❌ Not ready for deployment"
126+
127+ if [ "$VERSION" != "1.2.0" ]; then
128+ echo " - Version must be 1.2.0"
129+ fi
130+ if [ "$LINT_STATUS" != "passed" ]; then
131+ echo " - Linting must pass"
132+ fi
133+ if [ "$TEST_STATUS" != "passed" ]; then
134+ echo " - Tests must pass"
135+ fi
136+ if [ "$BUILD_STATUS" != "passed" ]; then
137+ echo " - Build must succeed"
138+ fi
139+ fi
140+
141+ deployment-summary :
142+ name : Deployment Summary
143+ runs-on : ubuntu-latest
144+ needs : deployment-readiness
145+ if : always()
146+
147+ steps :
148+ - name : Display deployment status
149+ run : |
150+ echo "## 🚀 Deployment Status Summary"
151+ echo ""
152+ echo "**Version:** ${{ needs.deployment-readiness.outputs.version }}"
153+ echo "**Ready for Deployment:** ${{ needs.deployment-readiness.outputs.ready-for-deployment }}"
154+ echo ""
155+ echo "### Status Checks:"
156+ echo "- **Lint:** ${{ needs.deployment-readiness.outputs.lint-status }}"
157+ echo "- **Tests:** ${{ needs.deployment-readiness.outputs.test-status }}"
158+ echo "- **Build:** ${{ needs.deployment-readiness.outputs.build-status }}"
159+ echo ""
160+
161+ if [ "${{ needs.deployment-readiness.outputs.ready-for-deployment }}" = "true" ]; then
162+ echo "🎉 **All checks passed! Ready to deploy v1.2.0**"
163+ echo ""
164+ echo "### Next Steps:"
165+ echo "1. Use the 'Quick Deploy v1.2.0' workflow to deploy immediately"
166+ echo "2. Or trigger the full 'Deployment Pipeline' for comprehensive checks"
167+ echo ""
168+ echo "### Quick Deploy Command:"
169+ echo "\`\`\`"
170+ echo "Go to Actions → Quick Deploy v1.2.0 → Run workflow"
171+ echo "Type 'DEPLOY' to confirm"
172+ echo "\`\`\`"
173+ else
174+ echo "❌ **Not ready for deployment. Please fix the issues above.**"
175+ fi
176+
177+ - name : Create deployment readiness badge
178+ if : github.ref == 'refs/heads/main'
179+ run : |
180+ if [ "${{ needs.deployment-readiness.outputs.ready-for-deployment }}" = "true" ]; then
181+ echo "Deployment ready - would update badge to green"
182+ else
183+ echo "Deployment not ready - would update badge to red"
184+ fi
0 commit comments