Skip to content

Commit dd0f31e

Browse files
committed
Add inject-secrets block to CD process
1 parent c22f731 commit dd0f31e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/CD-time-tracker-ui.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ jobs:
2424
with:
2525
node-version: '12.x'
2626

27+
- name: Inject Secrets
28+
shell: python
29+
env:
30+
SCOPES: ${{ secrets.scopes }}
31+
CLIENT_ID: ${{ secrets.client_id }}
32+
AUTHORITY: ${{ secrets.authority }}
33+
BASE_PATH: "src/environments/"
34+
run: |
35+
import os
36+
import json
37+
data = {}
38+
base_path = os.environ.get('BASE_PATH', 'src/environments/')
39+
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
40+
data = json.load(jsonFileRead)
41+
data["scopes"] = str(os.environ['SCOPES']).split(",")
42+
data["client_id"] = os.environ['CLIENT_ID']
43+
data["authority"] = os.environ['AUTHORITY']
44+
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
45+
json.dump(data, jsonFileWrite)
46+
2747
- name: 'run: npm install and build'
2848
run: |
2949
npm install

0 commit comments

Comments
 (0)