-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (56 loc) · 1.42 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Scheduled dbt run - prod
#on:
# schedule:
# - cron: "10 10 * * *"
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Manually trigger a dbt run'
required: false
type: boolean
jobs:
dbt_scheduled_run:
runs-on: ubuntu-latest
env:
PROJECT_NAME: ${{ secrets.PROJECT_NAME }}
DATASET: ${{ secrets.DATASET }}
steps:
- uses: "actions/checkout@main"
- name: Create file
run: touch google-key.json
- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > google-key.json
- 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