Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add inject-secrets block to CD process
  • Loading branch information
fabidick22 committed Mar 25, 2020
commit dd0f31ecadce2b13956e4dfadb3dc3020706f4f0
20 changes: 20 additions & 0 deletions .github/workflows/CD-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ jobs:
with:
node-version: '12.x'

- name: Inject Secrets
shell: python
env:
SCOPES: ${{ secrets.scopes }}
CLIENT_ID: ${{ secrets.client_id }}
AUTHORITY: ${{ secrets.authority }}
BASE_PATH: "src/environments/"
run: |
import os
import json
data = {}
base_path = os.environ.get('BASE_PATH', 'src/environments/')
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
data = json.load(jsonFileRead)
data["scopes"] = str(os.environ['SCOPES']).split(",")
data["client_id"] = os.environ['CLIENT_ID']
data["authority"] = os.environ['AUTHORITY']
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
json.dump(data, jsonFileWrite)

- name: 'run: npm install and build'
run: |
npm install
Expand Down