forked from ocademy-ai/machine-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 3.25 KB
/
awesome-release.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: awesome-release
on:
push:
branches:
- release
paths:
- 'awesome/database/data.db'
jobs:
compare-dbs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SQLite
run: sudo apt-get install sqlite3
- name: Install sqldiff tool
run: |
wget https://www.sqlite.org/2023/sqlite-tools-linux-x86-3420000.zip
unzip sqlite-tools-linux-x86-3420000.zip
- name: Get target branch database
run: |
wget -O target_data.db https://raw.githubusercontent.com/${{ github.repository }}/release/awesome/database/data.db
- name: Show database schema differences
run: ./sqlite-tools-linux-x86-3420000/sqldiff --schema target_data.db awesome/database/data.db
- name: Show substantial tables differences
run: |
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table Course target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table Organization target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table User target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table Tag target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table CourseTags target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table CourseOrganizations target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table UserCourses target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table Tutorial target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table TutorialTags target_data.db awesome/database/data.db
./sqlite-tools-linux-x86-3420000/sqldiff --primarykey --table UserTutorials target_data.db awesome/database/data.db
- name: Show all differences in database
run: ./sqlite-tools-linux-x86-3420000/sqldiff --primarykey target_data.db awesome/database/data.db
- name: Install dependencies
run: |
cd awesome
npm install
- name: Synchronize local and cloud databases
run: |
cd awesome/sync
export EMAIL=${{ secrets.EMAIL }}
export PASSWORD=${{ secrets.PASSWORD }}
export AWS_APPSYNC_AUTHENTICATIONTYPE=${{ secrets.AWS_APPSYNC_AUTHENTICATIONTYPE_PROD }}
export AWS_APPSYNC_GRAPHQLENDPOINT=${{ secrets.AWS_APPSYNC_GRAPHQLENDPOINT_PROD }}
export AWS_APPSYNC_REGION=${{ secrets.AWS_APPSYNC_REGION_PROD }}
export AWS_COGNITO_IDENTITY_POOL_ID=${{ secrets.AWS_COGNITO_IDENTITY_POOL_ID_PROD }}
export AWS_COGNITO_REGION=${{ secrets.AWS_COGNITO_REGION_PROD }}
export AWS_COGNITO_SIGNUP_ATTRIBUTES=${{ secrets.AWS_COGNITO_SIGNUP_ATTRIBUTES_PROD }}
export AWS_PROJECT_REGION=${{ secrets.AWS_PROJECT_REGION_PROD }}
export AWS_USER_POOLS_ID=${{ secrets.AWS_USER_POOLS_ID_PROD }}
export AWS_USER_POOLS_WEB_CLIENT_ID=${{ secrets.AWS_USER_POOLS_WEB_CLIENT_ID_PROD }}
node index.js