forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-deploy-smoke.yml
More file actions
73 lines (63 loc) 路 2.13 KB
/
Copy pathpost-deploy-smoke.yml
File metadata and controls
73 lines (63 loc) 路 2.13 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
name: Post-Deploy Smoke Tests
on:
workflow_run:
workflows:
- "Deploy to Staging"
- "Deploy to Production"
types:
- completed
concurrency:
group: smoke-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
jobs:
smoke-tests:
name: Run Smoke Tests
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Configure kubectl
uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}
- name: Database connectivity check
id: db-check
continue-on-error: true
run: |
bash infrastructure/scripts/smoke-tests/db-check.sh
- name: Service endpoint checks
id: service-check
continue-on-error: true
run: |
bash infrastructure/scripts/smoke-tests/service-check.sh
- name: DNS resolution checks
id: dns-check
run: |
kubectl run dns-test --image=busybox:1.36 --rm --restart=Never -n gistpin \
-- nslookup backend-service.gistpin.svc.cluster.local
- name: SSL certificate verification
id: ssl-check
continue-on-error: true
run: |
DOMAIN="${DEPLOY_DOMAIN:-gistpin.app}"
echo | openssl s_client -connect "${DOMAIN}:443" -servername "${DOMAIN}" 2>/dev/null | openssl x509 -noout -dates || echo "SSL check failed"
- name: Upload smoke test results
if: always()
uses: actions/upload-artifact@v4
with:
name: smoke-test-results
path: infrastructure/ci/reports/
retention-days: 14
- name: Notify on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Smoke test failed after deployment',
body: 'Smoke tests failed after deployment. Check workflow for details.',
labels: ['incident', 'infrastructure'],
})