-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (59 loc) · 2.36 KB
/
refresh_db.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
name: DB Refresh (Objects API)
on:
schedule:
# - cron: '0 5 * * *' # every day 5am GMT (12-1am EST/EDT)
- cron: '*/20 * * * *' # every 20 minutes
# - cron: '0 * * * *' # every hour on the hour
workflow_dispatch:
repository_dispatch:
types: [refresh-db]
jobs:
refresh-db:
# runs-on: ubuntu-18.04
# runs-on: ubuntu-latest # not sure which is more current when resolving merge conflicts
# todo: macos-latest: I think was just needed for datasets API because of high memory. should be able to switch back to ubuntu
runs-on: macos-latest
steps:
# Set up
- name: Checkout repository and submodules
uses: actions/checkout@v2
- name: Set up Python version
uses: actions/setup-python@v2
with:
# Consider '3.10' or 'v3.10.0': https://github.com/actions/setup-python/issues/160
python-version: '3.9.7' # Not sure why 3.9.7 here and 3.9 elsewhere. the .7 works on mac, but not on ubuntu
- name: Print commit hash & branch for rollbacks & troubleshooting
run: |
echo "Commit hash: ${{ github.sha }}"
echo "Branch: ${{ github.ref }}"
- name: 'Create env file'
run: |
mkdir env
echo "${{ secrets.ENV_FILE }}" > env/.env
- name: Create and start virtual environment
run: |
python3 -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
pip install -r requirements.txt
# Refresh
- name: Refresh db
run: |
python backend/db/refresh.py
- name: Commit changes to documentation
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Updating documentation in docs/backend/db/analysis.md
# fetch-missing-csets: Deactivated because various tweaks and default re-refresh buffer solve this problem, and
# also test-missing-csets is there as a redundancy. Original context:
# https://github.com/jhu-bids/TermHub/issues/573 https://github.com/jhu-bids/TermHub/issues/574
# - name: Fetch missing csets
# run: make fetch-missing-csets
# Test
# todo: add more tests, ideally
- name: Test missing csets
run: make test-missing-csets