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 authored and urmauur committed Nov 13, 2023
1 parent 3b1fd99 commit bff2588
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/jan-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ 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"
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
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $ yarn
### Local Development

```
$ cp .env.example .env
$ yarn start
```

Expand Down

0 comments on commit bff2588

Please sign in to comment.