-
Notifications
You must be signed in to change notification settings - Fork 10
89 lines (73 loc) · 2.84 KB
/
pull-sheets.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Sync Google Sheets data
on:
schedule:
- cron: "50 * * * *" # 50 past every hour
workflow_dispatch:
push:
branches:
- develop
jobs:
pull-sheets:
name: Sync Google Sheets data
runs-on: ubuntu-latest
steps:
- name: Clone BDDL repo
uses: actions/checkout@v3
with:
path: bddl
ref: develop
- name: Clone ig pipeline repo
uses: actions/checkout@v3
with:
repository: StanfordVL/ig_pipeline
path: ig_pipeline
token: ${{ secrets.REPO_TOKEN }}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64
- name: Authenticate on Google Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
# See if we need to re-pull any ig_pipeline data from DVC.
- name: Check cache for ig_pipeline data
id: cache-pipeline
uses: actions/cache@v3
with:
key: ig_pipeline-${{ hashFiles('ig_pipeline/dvc.lock') }}
path: |
ig_pipeline/artifacts/pipeline/combined_room_object_list.json
ig_pipeline/artifacts/pipeline/combined_room_object_list_future.json
ig_pipeline/artifacts/pipeline/object_inventory.json
ig_pipeline/artifacts/pipeline/object_inventory_future.json
- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Install dvc
run: pip install dvc[gs]
- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Pull dvc data
working-directory: ig_pipeline
run: dvc pull combined_room_object_list combined_room_object_list_future object_inventory object_inventory_future
- if: ${{ steps.cache-pipeline.outputs.cache-hit != 'true' }}
name: Unprotect data
working-directory: ig_pipeline
run: dvc unprotect artifacts/pipeline/combined_room_object_list.json artifacts/pipeline/combined_room_object_list_future.json artifacts/pipeline/object_inventory.json artifacts/pipeline/object_inventory_future.json
- name: Copy over ig_pipeline files
run: cp ig_pipeline/artifacts/pipeline/{combined_room_object_list,combined_room_object_list_future,object_inventory,object_inventory_future}.json bddl/bddl/generated_data
- name: Install BDDL
working-directory: bddl
run: pip install -e .
- name: Install dev requirements
working-directory: bddl
run: pip install -r requirements-dev.txt
- name: Refresh sheets data
working-directory: bddl
run: python -m bddl.data_generation.pull_sheets
- name: Refresh derivative data
working-directory: bddl
run: python -m bddl.data_generation.generate_datafiles
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Sync Google Sheets data"
repository: bddl