@@ -13,36 +13,31 @@ jobs:
1313 runs-on : ubuntu-latest
1414
1515 steps :
16- # ##############################################################
1716 # Checkout Repository
18- # ##############################################################
17+
1918 - name : Checkout repository
2019 uses : actions/checkout@v4
2120
22- # ##############################################################
2321 # Configure Git (for Terraform modules hosted on GitHub)
24- # ##############################################################
22+
2523 - name : Configure Git for Terraform module downloads
2624 run : |
2725 git config --global url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
2826
29- # ##############################################################
3027 # Login to Azure
31- # ##############################################################
28+
3229 - name : Azure Login
3330 uses : azure/login@v2
3431 with :
3532 creds : ${{ secrets.AZURE_CREDENTIALS }}
3633
37- # ##############################################################
3834 # Login to Azure Container Registry
39- # ##############################################################
35+
4036 - name : Log in to ACR
4137 run : az acr login --name ${{ secrets.ACR_NAME }}
4238
43- # ##############################################################
4439 # Determine Deployment Slot (Blue or Green)
45- # ##############################################################
40+
4641 - name : Determine Deployment Slot (Blue/Green)
4742 id : slot
4843 run : |
6055 echo $NEW_SLOT > $LAST_SLOT_FILE
6156 echo "slot=$NEW_SLOT" >> $GITHUB_OUTPUT
6257
63- # ##############################################################
6458 # Build & Push Docker Image to ACR
65- # ##############################################################
59+
6660 - name : Build and Push Docker image
6761 run : |
6862 IMAGE_TAG=${{ github.run_number }}
@@ -71,18 +65,15 @@ jobs:
7165 --image ${{ env.IMAGE_NAME }}:${IMAGE_TAG} \
7266 --image ${{ env.IMAGE_NAME }}:${{ steps.slot.outputs.slot }} \
7367 .
74-
75- # ##############################################################
7668 # Setup Terraform
77- # ##############################################################
69+
7870 - name : Setup Terraform
7971 uses : hashicorp/setup-terraform@v3
8072 with :
8173 terraform_version : 1.9.5
8274
83- # ##############################################################
8475 # Terraform Init
85- # ##############################################################
76+
8677 - name : Terraform Init
8778 working-directory : ${{ env.TF_DIR }}
8879 env :
9283 ARM_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
9384 run : terraform init -input=false
9485
95- # ##############################################################
9686 # Terraform Plan
97- # ##############################################################
87+
9888 - name : Terraform Plan
9989 working-directory : ${{ env.TF_DIR }}
10090 env :
@@ -110,9 +100,8 @@ jobs:
110100 -var="image_tag=${{ github.run_number }}" \
111101 -out=tfplan
112102
113- # ##############################################################
114103 # Terraform Apply (Deploy Selected Slot)
115- # ##############################################################
104+
116105 - name : Terraform Apply
117106 working-directory : ${{ env.TF_DIR }}
118107 env :
@@ -122,9 +111,8 @@ jobs:
122111 ARM_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
123112 run : terraform apply -auto-approve tfplan
124113
125- # ##############################################################
126114 # Optional: Swap Slots (Green <-> Blue)
127- # ##############################################################
115+
128116 - name : Swap Slots (Post Deployment)
129117 if : success()
130118 working-directory : ${{ env.TF_DIR }}
0 commit comments