You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if DOCKER_CONFIG=${{ env.DOCKER_CONFIG }} skaffold build --filename "k8s/production/skaffold.production.yaml" --default-repo=registry.digitalocean.com/aztlan-containers; then
47
-
return 0
48
-
fi
49
-
echo "Attempt $i failed. Retrying in $RETRY_DELAY seconds..."
50
-
sleep $RETRY_DELAY
51
-
done
52
-
return 1
53
-
}
54
-
55
-
if build_and_push; then
56
-
echo "Build and push successful"
57
-
else
58
-
echo "Build and push failed after $MAX_RETRIES attempts"
59
-
exit 1
60
-
fi
34
+
- name: Log in to DigitalOcean Container Registry with short-lived credentials
35
+
run: doctl registry login --expiry-seconds 1800
61
36
62
37
- name: Cleanup old images
63
38
run: |
64
39
chmod +x "./cleanup-script.sh"
65
-
./cleanup-script.sh
40
+
bash -x "./cleanup-script.sh"
66
41
67
42
- name: Save DigitalOcean kubeconfig
68
43
run: doctl kubernetes cluster kubeconfig save "chicmoz-prod"
69
44
70
45
- name: Deploy to cluster with Skaffold
71
-
run: |
72
-
MAX_RETRIES=3
73
-
RETRY_DELAY=10
74
-
75
-
for i in $(seq 1 $MAX_RETRIES); do
76
-
if DOCKER_CONFIG=${{ env.DOCKER_CONFIG }} skaffold run --filename "k8s/production/skaffold.production.yaml" --default-repo=registry.digitalocean.com/aztlan-containers; 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
46
+
run: skaffold run --filename "k8s/production/skaffold.production.yaml"
0 commit comments