Skip to content

Commit 1a05e36

Browse files
committed
feat: Integrate infrastructure repository into e2e process
1 parent 295c3da commit 1a05e36

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/deploy-to-feature-environment.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
author: ${{ steps.get_author.outputs.AUTHOR }}
7171
slugified_branch: ${{ steps.slugify_bname.outputs.stack }}
7272
e2e_branch: ${{ steps.get_e2e_branch.outputs.branch }}
73+
chart_branch: ${{ steps.get_chart_branch.outputs.branch }}
7374
steps:
7475
- uses: actions/checkout@v5
7576

@@ -141,6 +142,20 @@ jobs:
141142
fi
142143
echo "e2e branch name=${e2e_branch}"
143144
echo "branch=$e2e_branch" >> $GITHUB_OUTPUT
145+
- name: Get chart branch
146+
id: get_chart_branch
147+
# ls-remote should provide list of branches. When none are found, it should be empty string.
148+
run: |
149+
chart_repo_url="https://github.com/opencrvs/infrastructure.git"
150+
if [ -n "$(git ls-remote --heads "$chart_repo_url" "refs/heads/${{ github.head_ref }}")" ]; then
151+
branch=${{ github.head_ref }}
152+
elif [ -n "$(git ls-remote --heads "$chart_repo_url" "refs/heads/${{ github.base_ref }}")" ]; then
153+
branch="${{ github.base_ref }}"
154+
else
155+
branch="develop"
156+
fi
157+
echo "chart branch name=${branch}"
158+
echo "branch=$branch" >> $GITHUB_OUTPUT
144159
- name: Get PR Author
145160
id: get_author
146161
env:
@@ -266,6 +281,7 @@ jobs:
266281
stack: '${{ steps.generate_stack.outputs.stack }}',
267282
'keep-e2e': '${{ needs.generate_stack_name_and_branch.outputs.keep_e2e }}',
268283
'branch': '${{ needs.generate_stack_name_and_branch.outputs.e2e_branch }}',
284+
'chart-branch': '${{ needs.generate_stack_name_and_branch.outputs.chart_branch }}',
269285
'runtime': '${{ needs.generate_stack_name_and_branch.outputs.runtime }}'
270286
}
271287
});

0 commit comments

Comments
 (0)