-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (38 loc) · 1.12 KB
/
run_dbt_on_cron.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
name: Scheduled dbt run - prod
on:
schedule:
- cron: "10 10 * * *"
jobs:
dbt_scheduled_run:
runs-on: ubuntu-latest
env:
HOST: ${{ secrets.HOST }}
DATABASE: ${{ secrets.DATABASE }}
USERNAME: ${{ secrets.PROD_USERNAME }}
PASSWORD: ${{ secrets.PROD_PASSWORD }}
PORT: ${{ secrets.PORT }}
SCHEMA: ${{ secrets.PROD_SCHEMA }}
steps:
- uses: "actions/checkout@main"
- name: install requirements
run: pip install -q -r requirements.txt
- name: dbt deps
run: |
cd project_goes_here
dbt deps
- name: Get manifest.json from gh-pages branch
run: |
./get_manifest.sh
- name: dbt build
run: |
cd project_goes_here
if [ -f "prev_run_state/manifest.json" ]; then
dbt build --full-refresh --fail-fast --select state:modified+ --state prev_run_state
dbt docs generate
else
dbt build
dbt docs generate
fi
- name: Push new documentation to GH Pages
run: |
./save_and_publish_docs.sh