Skip to content

Commit 668b1b6

Browse files
committed
env per branch script fix1
1 parent f87aa25 commit 668b1b6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/app-ci.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ jobs:
2828
- name: Set environment for branch
2929
id: set-deploy-env
3030
run: |
31-
echo "checking branch name [$GITHUB_REF_NAME]"
32-
if [[ $GITHUB_REF_NAME == 'refs/heads/main' ]]; then
31+
echo "checking branch name [${{github.ref_name}}]"
32+
if [[ ${{github.ref_name}} == 'refs/heads/main' ]]; then
33+
echo "main branch detected. Set Development environment"
3334
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
34-
elif [[ $GITHUB_REF_NAME == *'refs/heads/release'* ]]; then
35+
elif [[ ${{github.ref_name}} == *'refs/heads/release'* ]]; then
36+
echo "release branch detected. Set Test environment"
3537
echo "DEPLOY_ENVIRONMENT=Test" >> "$GITHUB_OUTPUT"
36-
elif [[ $GITHUB_REF_NAME == *'refs/tags/v'* ]]; then
37-
echo "DEPLOY_ENVIRONMENT=Production" >> "$GITHUB_OUTPUT"
38+
elif [[ ${{github.ref_name}} == *'refs/tags/v'* ]]; then
39+
echo "tag detected. Set Production environment"
40+
echo "DEPLOY_ENVIRONMENT=Production" >> "$GITHUB_OUTPUT"
3841
else
42+
echo "branch not detected. Set Development environment as default"
3943
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
4044
fi
4145
- name: Build React Frontend

0 commit comments

Comments
 (0)