Skip to content

Commit

Permalink
env
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed Jul 1, 2024
1 parent 29dd0b0 commit 8a624f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/terraform-terragrunt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ "$BRANCH_NAME" == "main" ]]; then
echo "TF_WORKSPACE=prod-project" >> $GITHUB_ENV
echo "TG_WORKDIR=./environment/prod" >> $GITHUB_ENV
echo "TG_WORKDIR=environment/prod" >> $GITHUB_ENV
elif [[ "$BRANCH_NAME" == "stage" ]]; then
echo "TF_WORKSPACE=stage" >> $GITHUB_ENV
echo "TG_WORKDIR=./environment/stage" >> $GITHUB_ENV
echo "TG_WORKDIR=environment/stage" >> $GITHUB_ENV
elif [[ "$BRANCH_NAME" == "dev" ]]; then
echo "TF_WORKSPACE=dev" >> $GITHUB_ENV
echo "TG_WORKDIR=./environment/dev" >> $GITHUB_ENV
echo "TG_WORKDIR=environment/dev" >> $GITHUB_ENV
else
echo "TF_WORKSPACE=default" >> $GITHUB_ENV
echo "TG_WORKDIR=./environment/default" >> $GITHUB_ENV
echo "TG_WORKDIR=environment/default" >> $GITHUB_ENV
fi
- name: Set up Terraform CLI
Expand All @@ -57,13 +57,13 @@ jobs:
- name: Terragrunt init
run: |
cd ${{ env.TG_WORKDIR }}
cd ${{ github.workspace }}/$TG_WORKDIR
terragrunt init --terragrunt-non-interactive
echo "🔧 Terragrunt init completed!"
- name: Terragrunt plan
run: |
cd ${{ env.TG_WORKDIR }}
cd ${{ github.workspace }}/$TG_WORKDIR
terragrunt plan --terragrunt-non-interactive
echo "📝 Terragrunt plan completed!"
Expand Down

0 comments on commit 8a624f6

Please sign in to comment.