diff --git a/.github/workflows/jan-docs.yml b/.github/workflows/jan-docs.yml index 20b9c528f8..afb8ac463a 100644 --- a/.github/workflows/jan-docs.yml +++ b/.github/workflows/jan-docs.yml @@ -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 diff --git a/docs/.env.example b/docs/.env.example new file mode 100644 index 0000000000..4048b604cb --- /dev/null +++ b/docs/.env.example @@ -0,0 +1 @@ +GTM_ID=xxxx \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index f516942cbd..1bd3933d6e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,6 +11,7 @@ $ yarn ### Local Development ``` +$ cp .env.example .env $ yarn start ```