-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (56 loc) · 1.48 KB
/
run_incremental_dbt_on_merge.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
name: Incremental run dbt on merge to Main
on:
push:
branches: ["main"]
# leaving this for testing
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_run_on_merge_incremental:
runs-on: ubuntu-latest
env:
PROJECT_NAME: ${{ secrets.PROJECT_NAME }}
DATASET: ${{ secrets.DATASET }}
steps:
- uses: "actions/checkout@v4"
with:
ref: gh-pages
- uses: "actions/checkout@v4"
- 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
id: build
if: ${{ always() && '!cancelled()' }}
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
if: ${{ (success() || failure()) && steps.build.conclusion == 'success' }}
run: |
./save_and_publish_docs.sh