-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (56 loc) · 1.65 KB
/
backup.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
name: Data Backup
on:
schedule:
- cron: '30 4 */2 * *' # Run wvery days at 10:00 AM IST every 2 days
jobs:
backup_db_data:
runs-on: ubuntu-latest
env:
PG_DATABASE_URL: ${{ secrets.PG_DATABASE_URL }}
BACKUP_ENCRYPTION_KEY: ${{ secrets.BACKUP_ENCRYPTION_KEY }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: true
- name: Setup PostgreSQL
uses: tj-actions/install-postgresql@v3
with:
postgresql-version: 16
- name: Load Translations and DB Dump
run: |
cd src/db/scripts/
npx tsx backup_db_data.ts
- uses: actions/upload-artifact@v4
with:
name: db_backup
path: src/db/scripts/backup/
retention-days: 60
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
# set working directory to data/ramayan
# Install dependencies
- name: Install dependencies
working-directory: data/ramayan
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Generate Excel Files
working-directory: data/ramayan
run: |
python3 get_json.py --no-run-test
- run: |
npx vite-node data/ramayan/make_excel_files.ts --no-zip
- uses: actions/upload-artifact@v4
with:
name: excel_files
path: data/ramayan/out/
retention-days: 60