Skip to content

Commit 9043303

Browse files
committed
trying to fix
1 parent 3100763 commit 9043303

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ jobs:
4444

4545
# ✅ Install Terraform
4646
- name: Setup Terraform
47-
uses: hashicorp/setup-terraform@v2
48-
with:
49-
terraform_version: 1.6.6
47+
uses: hashicorp/setup-terraform@v3
5048

5149
# ✅ Terraform Init & Workspace
5250
- name: Terraform Init & Workspace
@@ -63,17 +61,17 @@ jobs:
6361
-var "stage=${{ github.event.inputs.stage }}"
6462
6563
# ✅ Get EC2 IPs & S3 Bucket
66-
- name: Get EC2 Public IP & S3 Bucket Name
67-
working-directory: ${{ env.TF_WORKING_DIR }}
64+
- name: Get EC2s Public IPs & S3 Bucket Name
6865
run: |
69-
APP_IP=$(terraform output -raw instance_public_ip | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n1)
70-
VERIFIER_IP=$(terraform output -raw verifier_instance_public_ip | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n1)
71-
S3_BUCKET=$(terraform output -raw s3_log_bucket | grep -oE 'techeazy-logs-[^[:space:]]+' | head -n1)
66+
echo "INSTANCE_IP=$(terraform output -raw instance_public_ip)" >> $GITHUB_ENV
67+
echo "VERIFIER_IP=$(terraform output -raw verifier_instance_public_ip)" >> $GITHUB_ENV
68+
echo "S3_BUCKET=$(terraform output -raw s3_log_bucket)" >> $GITHUB_ENV
7269
73-
echo "📦 App IP: $APP_IP"
70+
echo "📦 App IP: $INSTANCE_IP"
7471
echo "🔑 Verifier IP: $VERIFIER_IP"
7572
echo "🪣 S3 Bucket: $S3_BUCKET"
7673
74+
7775
# ✅ Wait for App Initialization
7876
- name: Wait for App Initialization
7977
run: |
@@ -83,9 +81,9 @@ jobs:
8381
# ✅ Validate App Health
8482
- name: Validate App Health
8583
run: |
86-
echo "🌐 Checking app health at http://$APP_IP:80"
84+
echo "🌐 Checking app health at http://$INSTANCE_IP:80"
8785
for i in {1..10}; do
88-
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://$APP_IP:80)
86+
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://$INSTANCE_IP:80)
8987
if [[ "$STATUS" == "200" ]]; then
9088
echo "✅ App is healthy (HTTP 200)"
9189
exit 0

0 commit comments

Comments
 (0)