Update CICD to fill secret to .env file jan docs
This commit is contained in:
parent
3b1fd9950a
commit
bff2588ecc
19
.github/workflows/jan-docs.yml
vendored
19
.github/workflows/jan-docs.yml
vendored
@ -25,6 +25,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 18
|
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
|
- name: Install dependencies
|
||||||
run: yarn install
|
run: yarn install
|
||||||
working-directory: docs
|
working-directory: docs
|
||||||
|
|||||||
1
docs/.env.example
Normal file
1
docs/.env.example
Normal file
@ -0,0 +1 @@
|
|||||||
|
GTM_ID=xxxx
|
||||||
@ -11,6 +11,7 @@ $ yarn
|
|||||||
### Local Development
|
### Local Development
|
||||||
|
|
||||||
```
|
```
|
||||||
|
$ cp .env.example .env
|
||||||
$ yarn start
|
$ yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user