Skip to content

Commit

Permalink
Update CICD to fill secret to .env file jan docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-service-account committed Nov 13, 2023
1 parent 20bdd56 commit 5105a87
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/jan-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ jobs:
with:
node-version: 18

- name: Install jq
uses: dcarbone/install-jq-action@v2.0.1

- name: Fill env vars
run: |
env_example_file=".env.example"
touch .env
while IFS= read -r line || [[ -n "$line" ]]; do
if [[ "$line" == *"="* ]]; then
var_name=$(echo $line | cut -d '=' -f 1)
echo $var_name
var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
echo "$var_name=$var_value" >> .env
fi
done < "$env_example_file"
cat .env
working-directory: docs
env:
SECRETS: '${{ toJson(secrets) }}'

- name: Install dependencies
run: yarn install
working-directory: docs
Expand Down
1 change: 1 addition & 0 deletions docs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GTM_ID=xxxx

0 comments on commit 5105a87

Please sign in to comment.