-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (34 loc) · 1.13 KB
/
jsonPrep.yml
File metadata and controls
42 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Parse and Combine JSON Files
on:
push:
branches: [ main ]
env:
AWS_REGION: eu-west-1
S3_BUCKET: docsgpt
jobs:
parse_and_combine:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Parsing and Combining JSON Files
run: |
git config --global user.email "a@tushynski.me"
git config --global user.name "Alex"
json_files=()
while IFS= read -r -d '' file; do
json_files+=("$(cat "$file")")
done < <(find vectors -type f -name "*.json" -print0)
echo "[$(IFS=,; echo "${json_files[*]}")]" > combined.json
git add combined.json
git commit -m "Update combined.json"
git push origin main
aws s3 cp combined.json s3://${{ env.S3_BUCKET }}/combined.json