-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (55 loc) · 1.84 KB
/
dbt.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: "Run DBT (daily)"
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *" # Every Day at noon
env:
DBT_PROFILES_DIR: .
DUCKDB_PATH: github_contributions.duckdb
PYTHON_VERSION: 3.9
REINGEST_ALL: false # set to true to mimic a --full-refresh
jobs:
dbt:
runs-on: self-hosted
timeout-minutes: 10080
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install dbt-duckdb==1.7.2 github_contributions/
dbt deps
- name: Download duckdb # retrieves .duckdb file from last successful run (last day in happy scenario)
if: ${{ env.REINGEST_ALL != 'true' }}
uses: dawidd6/action-download-artifact@v2
with:
name: ${{ env.DUCKDB_PATH }}
workflow: dbt.yml
workflow_conclusion: success
continue-on-error: true
- name: dbt build
run: dbt build --fail-fast
- name: Upload duckdb for Debugging
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: github_contributions_debug_${{ github.run_id }}.duckdb
path: ${{ env.DUCKDB_PATH }}
# CHANGE WITH CAUSION!!!
# The retention days determines how long it takes for author data to be
# forgotten
retention-days: 2
- name: Upload duckdb
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: github_contributions.duckdb
path: ${{ env.DUCKDB_PATH }}
# CHANGE WITH CAUSION!!!
# The retention days determines how long it takes for author data to be
# forgotten
retention-days: 15