Skip to content

Commit

Permalink
Change multiline substitution from sed to awk
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroslavPshenichnikov committed Jan 17, 2024
1 parent acd1564 commit fe25db8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sam-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
echo '${{ secrets.MAIN_REGIONS_MAP_BASE64 }}' | base64 -d > regions_map.tmp
echo '${{ secrets.MAIN_DDB_REGIONS_MAP_BASE64 }}' | base64 -d > ddb_regions_map.tmp
fi
sed -i "s/regionsMap_placeholder/$(cat regions_map.tmp)/g" ./docspace-reverse-proxy/index.mjs
sed -i "s/ddbRegionsMap_placeholder/$(cat ddb_regions_map.tmp)/g" ./docspace-reverse-proxy/index.mjs
awk -v rmap="$(<regions_map.tmp)" '{ gsub(/regionsMap_placeholder/, rmap); print; }' ./docspace-reverse-proxy/index.mjs > temp_index.mjs && mv temp_index.mjs ./docspace-reverse-proxy/index.mjs
awk -v rmap="$(<ddb_regions_map.tmp)" '{ gsub(/ddbRegionsMap_placeholder/, rmap); print; }' ./docspace-reverse-proxy/index.mjs > temp_index.mjs && mv temp_index.mjs ./docspace-reverse-proxy/index.mjs
# Build and deploy stack
- run: sam build -u --template-file ${GITHUB_REF_NAME}-template.yaml
Expand Down

0 comments on commit fe25db8

Please sign in to comment.