-
Notifications
You must be signed in to change notification settings - Fork 1
704 lines (597 loc) Β· 25.9 KB
/
Copy pathcd.yml
File metadata and controls
704 lines (597 loc) Β· 25.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
name: π Continuous Deployment
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: true
default: 'test'
type: choice
options:
- test
- staging
- production
force_deploy:
description: 'Force deployment (skip checks)'
required: false
default: false
type: boolean
env:
REGISTRY: docker.io
REGISTRY_NAMESPACE: websoft9
jobs:
# Pre-deployment check
pre-deployment-check:
name: π Pre-deployment Check
runs-on: ubuntu-latest
outputs:
deploy_environment: ${{ steps.determine-env.outputs.environment }}
should_deploy: ${{ steps.check-conditions.outputs.should_deploy }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Determine deployment environment
id: determine-env
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
else
echo "environment=test" >> $GITHUB_OUTPUT
fi
- name: Check deployment conditions
id: check-conditions
run: |
environment="${{ steps.determine-env.outputs.environment }}"
force_deploy="${{ inputs.force_deploy }}"
echo "Deployment environment: $environment"
echo "Force deployment: $force_deploy"
# Check if deployment should proceed
should_deploy="true"
if [ "$force_deploy" != "true" ]; then
# Check recent CI status
echo "Checking recent CI status..."
# Here you can add more check logic
# For example: check recent test results, security scan results, etc.
fi
echo "should_deploy=$should_deploy" >> $GITHUB_OUTPUT
- name: Validate deployment target
run: |
environment="${{ steps.determine-env.outputs.environment }}"
case $environment in
test)
echo "β
Deploy to test environment"
;;
staging)
echo "β
Deploy to staging environment"
;;
production)
echo "β
Deploy to production environment"
echo "β οΈ Production environment deployment requires additional approval"
;;
*)
echo "β Invalid deployment environment: $environment"
exit 1
;;
esac
# Build deployment images
build-deployment-images:
name: π¨ Build Deployment Images
runs-on: ubuntu-latest
needs: [pre-deployment-check]
if: needs.pre-deployment-check.outputs.should_deploy == 'true'
strategy:
matrix:
service: ['api-service', 'websoft9-agent']
include:
- service: api-service
context: api-service
- service: websoft9-agent
context: websoft9-agent
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/${{ matrix.service }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=deploy-${{ needs.pre-deployment-check.outputs.deploy_environment }}-{{sha}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Deploy to test environment
deploy-to-test:
name: π§ͺ Deploy to Test Environment
runs-on: ubuntu-latest
needs: [pre-deployment-check, build-deployment-images]
if: needs.pre-deployment-check.outputs.deploy_environment == 'test'
environment:
name: ${{ needs.pre-deployment-check.outputs.deploy_environment }}
url: https://test.websoft9.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up deployment configuration
run: |
echo "Configuring test environment deployment parameters..."
# Create deployment configuration
mkdir -p deploy/test
cat > deploy/test/docker-compose.yml << 'EOF'
version: '3.8'
services:
api-service:
image: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/api-service:deploy-test-${{ github.sha }}
ports:
- "8080:8080"
- "9090:9090"
environment:
- GIN_MODE=release
- DB_TYPE=sqlite
- DB_DSN=/app/data/websoft9.db
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${{ secrets.TEST_JWT_SECRET }}
depends_on:
- redis
restart: unless-stopped
volumes:
- api_data:/app/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
websoft9-agent:
image: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/websoft9-agent:deploy-test-${{ github.sha }}
environment:
- LOG_LEVEL=info
- SERVER_URL=http://api-service:8080
- AGENT_ID=test-agent-1
depends_on:
- api-service
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
redis:
image: redis:7.0
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
volumes:
api_data:
redis_data:
EOF
- name: Deploy to test environment
run: |
echo "Deploying to test environment..."
# This should be the actual deployment logic
# For example: SSH to test server, pull images, update services, etc.
# Simulate deployment process
echo "1. Stopping existing services..."
# docker-compose -f deploy/test/docker-compose.yml down
echo "2. Pulling latest images..."
# docker-compose -f deploy/test/docker-compose.yml pull
echo "3. Starting services..."
# docker-compose -f deploy/test/docker-compose.yml up -d
echo "β
Test environment deployment completed"
- name: Wait for services to be ready
run: |
echo "Waiting for services to start..."
# Wait for health checks to pass
max_attempts=30
attempt=1
while [ $attempt -le $max_attempts ]; do
echo "Checking service status... ($attempt/$max_attempts)"
# This should check actual service status
# For example: curl health check endpoints
# Simulate health check
if [ $attempt -ge 5 ]; then
echo "β
All services are ready"
break
fi
sleep 10
attempt=$((attempt + 1))
done
if [ $attempt -gt $max_attempts ]; then
echo "β Service startup timeout"
exit 1
fi
- name: Run deployment verification tests
run: |
echo "Running deployment verification tests..."
# Basic connectivity test
echo "1. API service connectivity test..."
# curl -f http://test.websoft9.com/health || exit 1
echo "2. SQLite database connection test..."
# Test SQLite database connection
echo "3. Functional verification test..."
# Run verification tests for key functions
echo "β
Deployment verification tests passed"
# Deploy to staging environment
deploy-to-staging:
name: π Deploy to Staging Environment
runs-on: ubuntu-latest
needs: [pre-deployment-check, build-deployment-images]
if: needs.pre-deployment-check.outputs.deploy_environment == 'staging'
environment:
name: ${{ needs.pre-deployment-check.outputs.deploy_environment }}
url: https://staging.websoft9.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to staging environment
run: |
echo "Deploying to staging environment..."
# Staging environment deployment logic
# Usually includes stricter validation and monitoring
echo "β
Staging environment deployment completed"
- name: Run staging verification tests
run: |
echo "Running staging environment verification tests..."
# More comprehensive verification tests
echo "β
Staging environment verification tests passed"
# Deploy to production environment
deploy-to-production:
name: π Deploy to Production Environment
runs-on: ubuntu-latest
needs: [pre-deployment-check, build-deployment-images]
if: needs.pre-deployment-check.outputs.deploy_environment == 'production'
environment:
name: ${{ needs.pre-deployment-check.outputs.deploy_environment }}
url: https://websoft9.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create deployment backup
run: |
echo "Creating deployment backup..."
# Backup current production environment configuration and data
backup_timestamp=$(date +%Y%m%d_%H%M%S)
echo "backup_timestamp=$backup_timestamp" >> $GITHUB_ENV
echo "β
Backup created: $backup_timestamp"
- name: Deploy to production environment
run: |
echo "Deploying to production environment..."
# Production environment deployment logic
# Includes blue-green deployment, rolling updates, etc.
echo "β
Production environment deployment completed"
- name: Run production verification tests
run: |
echo "Running production environment verification tests..."
# Production environment verification tests
echo "β
Production environment verification tests passed"
- name: Enable production traffic
run: |
echo "Enabling production environment traffic..."
# Switch traffic to new version
echo "β
Production environment traffic enabled"
# Post-deployment health check
post-deployment-health-check:
name: π₯ Post-deployment Health Check
runs-on: ubuntu-latest
needs: [pre-deployment-check, deploy-to-test, deploy-to-staging, deploy-to-production]
if: always() && (needs.deploy-to-test.result == 'success' || needs.deploy-to-staging.result == 'success' || needs.deploy-to-production.result == 'success')
steps:
- name: Comprehensive health check
run: |
environment="${{ needs.pre-deployment-check.outputs.deploy_environment }}"
echo "Performing comprehensive health check for $environment environment..."
# Set environment URL
case $environment in
test)
base_url="https://test.websoft9.com"
;;
staging)
base_url="https://staging.websoft9.com"
;;
production)
base_url="https://websoft9.com"
;;
esac
echo "Checking URL: $base_url"
# Health check items
checks=(
"API Service Status"
"SQLite Database Connection"
"Redis Connection"
"Key Function Verification"
"Performance Metrics Check"
)
failed_checks=()
for check in "${checks[@]}"; do
echo "Performing check: $check"
# This should be actual health check logic
# Simulate check results
if [ "$check" = "Performance Metrics Check" ] && [ "$environment" = "production" ]; then
# Simulate that production environment performance check might fail
if [ $((RANDOM % 10)) -lt 2 ]; then
failed_checks+=("$check")
echo "β $check failed"
continue
fi
fi
echo "β
$check passed"
done
if [ ${#failed_checks[@]} -gt 0 ]; then
echo ""
echo "β The following health checks failed:"
for check in "${failed_checks[@]}"; do
echo " - $check"
done
# Set output for subsequent steps to handle
echo "health_check_failed=true" >> $GITHUB_ENV
echo "failed_checks=${failed_checks[*]}" >> $GITHUB_ENV
else
echo ""
echo "β
All health checks passed"
echo "health_check_failed=false" >> $GITHUB_ENV
fi
- name: Handle health check failures
if: env.health_check_failed == 'true'
run: |
environment="${{ needs.pre-deployment-check.outputs.deploy_environment }}"
echo "Handling health check failures..."
if [ "$environment" = "production" ]; then
echo "β οΈ Production environment health check failed, consider rollback"
# This can trigger automatic rollback logic
echo "Triggering rollback process..."
# Send emergency notification
echo "Sending emergency notification..."
else
echo "β οΈ $environment environment health check failed, manual intervention required"
fi
# Deployment notification
deployment-notification:
name: π’ Deployment Notification
runs-on: ubuntu-latest
needs: [pre-deployment-check, deploy-to-test, deploy-to-staging, deploy-to-production, post-deployment-health-check]
if: always()
steps:
- name: Determine deployment result
id: result
run: |
environment="${{ needs.pre-deployment-check.outputs.deploy_environment }}"
# Determine deployment result
case $environment in
test)
deploy_result="${{ needs.deploy-to-test.result }}"
;;
staging)
deploy_result="${{ needs.deploy-to-staging.result }}"
;;
production)
deploy_result="${{ needs.deploy-to-production.result }}"
;;
esac
health_check_result="${{ needs.post-deployment-health-check.result }}"
echo "environment=$environment" >> $GITHUB_OUTPUT
echo "deploy_result=$deploy_result" >> $GITHUB_OUTPUT
echo "health_check_result=$health_check_result" >> $GITHUB_OUTPUT
# Determine overall status
if [ "$deploy_result" = "success" ] && [ "$health_check_result" = "success" ]; then
echo "overall_status=success" >> $GITHUB_OUTPUT
echo "status_message=Deployment successful" >> $GITHUB_OUTPUT
elif [ "$deploy_result" = "success" ] && [ "$health_check_result" = "failure" ]; then
echo "overall_status=warning" >> $GITHUB_OUTPUT
echo "status_message=Deployment successful but health check failed" >> $GITHUB_OUTPUT
else
echo "overall_status=failure" >> $GITHUB_OUTPUT
echo "status_message=Deployment failed" >> $GITHUB_OUTPUT
fi
- name: Prepare email content
id: email
run: |
status="${{ steps.result.outputs.overall_status }}"
message="${{ steps.result.outputs.status_message }}"
environment="${{ steps.result.outputs.environment }}"
# Set email subject
if [ "$status" = "success" ]; then
subject="β
Deployment Successful - ${{ github.repository }} ($environment)"
elif [ "$status" = "warning" ]; then
subject="β οΈ Deployment Warning - ${{ github.repository }} ($environment)"
else
subject="β Deployment Failed - ${{ github.repository }} ($environment)"
fi
echo "subject=$subject" >> $GITHUB_OUTPUT
# Set environment URL
case $environment in
test)
env_url="https://test.websoft9.com"
;;
staging)
env_url="https://staging.websoft9.com"
;;
production)
env_url="https://websoft9.com"
;;
*)
env_url="N/A"
;;
esac
# Generate email body
cat > email_body.html << EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
.header { background-color: #f4f4f4; padding: 20px; border-radius: 5px; margin-bottom: 20px; }
.status-success { color: #28a745; }
.status-warning { color: #ffc107; }
.status-failure { color: #dc3545; }
.env-badge {
display: inline-block;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
}
.env-test { background-color: #17a2b8; color: white; }
.env-staging { background-color: #ffc107; color: black; }
.env-production { background-color: #dc3545; color: white; }
.info-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.info-table th, .info-table td { border: 1px solid #ddd; padding: 12px; text-align: left; }
.info-table th { background-color: #f2f2f2; }
.footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 12px; color: #666; }
</style>
</head>
<body>
<div class="header">
<h2>π Deployment Execution Report</h2>
<p><strong>Repository:</strong> ${{ github.repository }}</p>
<p><strong>Environment:</strong> <span class="env-badge env-$environment">$environment</span></p>
<p><strong>Status:</strong> <span class="status-$(echo $status | tr '[:upper:]' '[:lower:]')">$message</span></p>
</div>
<h3>π Deployment Information</h3>
<table class="info-table">
<tr><th>Target Environment</th><td>$environment</td></tr>
<tr><th>Environment URL</th><td><a href="$env_url">$env_url</a></td></tr>
<tr><th>Branch</th><td>${{ github.ref_name }}</td></tr>
<tr><th>Commit</th><td>${{ github.sha }}</td></tr>
<tr><th>Deployer</th><td>${{ github.actor }}</td></tr>
<tr><th>Execution Time</th><td>$(date)</td></tr>
</table>
<h3>π Execution Results</h3>
<table class="info-table">
<tr><th>Stage</th><th>Status</th></tr>
<tr><td>Pre-deployment Check</td><td>success</td></tr>
<tr><td>Image Build</td><td>success</td></tr>
<tr><td>Environment Deployment</td><td>${{ steps.result.outputs.deploy_result }}</td></tr>
<tr><td>Health Check</td><td>${{ steps.result.outputs.health_check_result }}</td></tr>
</table>
<h3>π Related Links</h3>
<ul>
<li><a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">View Workflow Run Details</a></li>
<li><a href="${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}">View Commit Details</a></li>
<li><a href="$env_url">Access Deployment Environment</a></li>
<li><a href="${{ github.server_url }}/${{ github.repository }}">Access Repository</a></li>
</ul>
<div class="footer">
<p>This email is automatically sent by GitHub Actions, please do not reply.</p>
<p>If you have any questions, please contact the development team.</p>
</div>
</body>
</html>
EOF
- name: Create deployment record
uses: actions/github-script@v6
with:
script: |
const environment = '${{ steps.result.outputs.environment }}';
const deployResult = '${{ steps.result.outputs.deploy_result }}';
const healthCheckResult = '${{ steps.result.outputs.health_check_result }}';
const overallStatus = '${{ steps.result.outputs.overall_status }}';
// Create deployment record Issue
const title = `[Deployment] ${environment} - ${overallStatus} - ${new Date().toISOString().split('T')[0]}`;
const body = `## π Deployment Record
**Environment:** ${environment}
**Status:** ${overallStatus}
**Time:** ${new Date().toISOString()}
**Branch:** ${{ github.ref_name }}
**Commit:** ${{ github.sha }}
**Deployer:** ${{ github.actor }}
### Deployment Results
- **Deployment Status:** ${deployResult}
- **Health Check:** ${healthCheckResult}
### Related Links
- [Workflow Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- [Commit Details](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
---
*This record was automatically created by the deployment workflow*`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
labels: ['deployment', environment, overallStatus]
});
# Deployment summary
deployment-summary:
name: π Deployment Summary
runs-on: ubuntu-latest
needs: [pre-deployment-check, deploy-to-test, deploy-to-staging, deploy-to-production, post-deployment-health-check]
if: always()
steps:
- name: Generate deployment summary
run: |
environment="${{ needs.pre-deployment-check.outputs.deploy_environment }}"
echo "# π Deployment Execution Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Target Environment:** $environment" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "**Deployer:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "**Execution Time:** $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## π Execution Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Stage | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------|------|" >> $GITHUB_STEP_SUMMARY
echo "| Pre-deployment Check | ${{ needs.pre-deployment-check.result }} |" >> $GITHUB_STEP_SUMMARY
case $environment in
test)
echo "| Test Environment Deployment | ${{ needs.deploy-to-test.result }} |" >> $GITHUB_STEP_SUMMARY
;;
staging)
echo "| Staging Environment Deployment | ${{ needs.deploy-to-staging.result }} |" >> $GITHUB_STEP_SUMMARY
;;
production)
echo "| Production Environment Deployment | ${{ needs.deploy-to-production.result }} |" >> $GITHUB_STEP_SUMMARY
;;
esac
echo "| Post-deployment Health Check | ${{ needs.post-deployment-health-check.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Determine overall status and add appropriate summary
if [[ "${{ needs.post-deployment-health-check.result }}" == "success" ]]; then
echo "## β
Deployment Successful" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Application has been successfully deployed to $environment environment, all health checks have passed." >> $GITHUB_STEP_SUMMARY
else
echo "## β Deployment Issues" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "There were issues during the deployment process, please check detailed logs." >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "## π Related Links" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- [Workflow Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
echo "- [Commit Details](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY
case $environment in
test)
echo "- [Test Environment](https://test.websoft9.com)" >> $GITHUB_STEP_SUMMARY
;;
staging)
echo "- [Staging Environment](https://staging.websoft9.com)" >> $GITHUB_STEP_SUMMARY
;;
production)
echo "- [Production Environment](https://websoft9.com)" >> $GITHUB_STEP_SUMMARY
;;
esac