File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,18 @@ jobs:
28
28
- name : Set environment for branch
29
29
id : set-deploy-env
30
30
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"
33
34
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"
35
37
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"
38
41
else
42
+ echo "branch not detected. Set Development environment as default"
39
43
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
40
44
fi
41
45
- name : Build React Frontend
You can’t perform that action at this time.
0 commit comments