Commit 3b57d79 1 parent d6d36ce commit 3b57d79 Copy full SHA for 3b57d79
File tree 1 file changed +39
-2
lines changed
1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change 41
41
chmod +x ".github/workflows/cleanup-script.sh"
42
42
bash -x ".github/workflows/cleanup-script.sh"
43
43
44
+ - name : Build and Push Images
45
+ run : |
46
+ MAX_RETRIES=3
47
+ RETRY_DELAY=10
48
+
49
+ build_and_push() {
50
+ for i in $(seq 1 $MAX_RETRIES); do
51
+ if skaffold build --filename "k8s/production/skaffold.production.yaml"; then
52
+ return 0
53
+ fi
54
+ echo "Attempt $i failed. Retrying in $RETRY_DELAY seconds..."
55
+ sleep $RETRY_DELAY
56
+ done
57
+ return 1
58
+ }
59
+
60
+ if build_and_push; then
61
+ echo "Build and push successful"
62
+ else
63
+ echo "Build and push failed after $MAX_RETRIES attempts"
64
+ exit 1
65
+ fi
66
+
44
67
- name : Save DigitalOcean kubeconfig
45
- run : doctl kubernetes cluster kubeconfig save chicmoz-prod
68
+ run : doctl kubernetes cluster kubeconfig save " chicmoz-prod"
46
69
47
70
- name : Deploy to cluster with Skaffold
48
- run : skaffold run --filename k8s/production/skaffold.production.yaml
71
+ run : |
72
+ MAX_RETRIES=3
73
+ RETRY_DELAY=10
74
+
75
+ for i in $(seq 1 $MAX_RETRIES); do
76
+ if skaffold run --filename "k8s/production/skaffold.production.yaml"; then
77
+ echo "Deployment successful"
78
+ exit 0
79
+ fi
80
+ echo "Attempt $i failed. Retrying in $RETRY_DELAY seconds..."
81
+ sleep $RETRY_DELAY
82
+ done
83
+
84
+ echo "Deployment failed after $MAX_RETRIES attempts"
85
+ exit 1
You can’t perform that action at this time.
0 commit comments