Skip to content

Commit 6297029

Browse files
committed
trying to fix
1 parent 3100763 commit 6297029

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 10 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,16 +61,20 @@ jobs:
6361
-var "stage=${{ github.event.inputs.stage }}"
6462
6563
# ✅ Get EC2 IPs & S3 Bucket
66-
- name: Get EC2 Public IP & S3 Bucket Name
64+
- name: Get EC2s Public IPs & S3 Bucket Name
6765
working-directory: ${{ env.TF_WORKING_DIR }}
6866
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)
67+
echo "INSTANCE_IP=$(terraform output -raw instance_public_ip)" >> $GITHUB_ENV
68+
echo "VERIFIER_IP=$(terraform output -raw verifier_instance_public_ip)" >> $GITHUB_ENV
69+
echo "S3_BUCKET=$(terraform output -raw s3_log_bucket)" >> $GITHUB_ENV
7270
73-
echo "📦 App IP: $APP_IP"
71+
echo "📦 App IP: $INSTANCE_IP"
7472
echo "🔑 Verifier IP: $VERIFIER_IP"
7573
echo "🪣 S3 Bucket: $S3_BUCKET"
74+
echo "📦 App IP: ${{ env.INSTANCE_IP }}"
75+
echo "🔑 Verifier IP: ${{ env.VERIFIER_IP }}"
76+
echo "🪣 S3 Bucket: ${{ env.S3_BUCKET }}"
77+
7678
7779
# ✅ Wait for App Initialization
7880
- name: Wait for App Initialization
@@ -83,9 +85,9 @@ jobs:
8385
# ✅ Validate App Health
8486
- name: Validate App Health
8587
run: |
86-
echo "🌐 Checking app health at http://$APP_IP:80"
88+
echo "🌐 Checking app health at http://${{ env.INSTANCE_IP }}:80"
8789
for i in {1..10}; do
88-
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://$APP_IP:80)
90+
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://$INSTANCE_IP:80)
8991
if [[ "$STATUS" == "200" ]]; then
9092
echo "✅ App is healthy (HTTP 200)"
9193
exit 0

0 commit comments

Comments
 (0)