Skip to content

Commit

Permalink
FIX pipeline variables export v3
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroslavPshenichnikov committed Nov 28, 2023
1 parent 04087f7 commit 5dffe5f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/sam-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,19 @@ jobs:
- name: Set ELB configuration
run: |
BRANCH="${{ github.ref_name }}" # develop or main
DEFAULT_REGION_ELB=$(eval echo \$${BRANCH}_DEFAULT_REGION_ELB)
EU_CENTRAL_1_REGION_ELB=$(eval echo \$${BRANCH}_EU_CENTRAL_1_REGION_ELB)
US_EAST_2_REGION_ELB=$(eval echo \$${BRANCH}_US_EAST_2_REGION_ELB)
if [[ "${{ github.ref_name }}" == "develop" ]]; then
export DEFAULT_REGION_ELB="${{ secrets.DEVELOP_DEFAULT_REGION_ELB }}"
export EU_CENTRAL_1_REGION_ELB="${{ secrets.DEVELOP_EU_CENTRAL_1_REGION_ELB }}"
export US_EAST_2_REGION_ELB="${{ secrets.DEVELOP_US_EAST_2_REGION_ELB }}"
elif [[ "${{ github.ref_name }}" == "main" ]]; then
export DEFAULT_REGION_ELB="${{ secrets.MAIN_DEFAULT_REGION_ELB }}"
export EU_CENTRAL_1_REGION_ELB="${{ secrets.MAIN_EU_CENTRAL_1_REGION_ELB }}"
export US_EAST_2_REGION_ELB="${{ secrets.MAIN_US_EAST_2_REGION_ELB }}"
fi
sed -i "s/default_region_elb_placeholder/$DEFAULT_REGION_ELB/g" ./docspace-reverse-proxy/index.mjs
sed -i "s/eu_central_1_region_elb_placeholder/$EU_CENTRAL_1_REGION_ELB/g" ./docspace-reverse-proxy/index.mjs
sed -i "s/us_east_2_region_elb_placeholder/$US_EAST_2_REGION_ELB/g" ./docspace-reverse-proxy/index.mjs
env:
DEVELOP_DEFAULT_REGION_ELB: ${{ secrets.DEVELOP_DEFAULT_REGION_ELB }}
MAIN_DEFAULT_REGION_ELB: ${{ secrets.MAIN_DEFAULT_REGION_ELB }}
DEVELOP_EU_CENTRAL_1_REGION_ELB: ${{ secrets.DEVELOP_EU_CENTRAL_1_REGION_ELB }}
MAIN_EU_CENTRAL_1_REGION_ELB: ${{ secrets.MAIN_EU_CENTRAL_1_REGION_ELB }}
DEVELOP_US_EAST_2_REGION_ELB: ${{ secrets.DEVELOP_US_EAST_2_REGION_ELB }}
MAIN_US_EAST_2_REGION_ELB: ${{ secrets.MAIN_US_EAST_2_REGION_ELB }}
# Build and deploy stack
- run: sam build -u --template-file ${GITHUB_REF_NAME}-template.yaml
Expand Down

0 comments on commit 5dffe5f

Please sign in to comment.