-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (44 loc) · 1.14 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
name: "Run dbt"
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 12 * * 4' # Every Thursday at noon
env:
DBT_PROFILES_DIR: .
DUCKDB_PATH: github_contributions.duckdb
PYTHON_VERSION: 3.9
jobs:
dbt:
runs-on: ubuntu-latest
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 github_contributions/
dbt deps
- name: dbt build
run: dbt build
- name: Delete duckdb database
run: |
if [ -e "${{ env.DUCKDB_PATH }}" ]; then
rm "${{ env.DUCKDB_PATH }}"
fi
if: ${{ failure() }}
- name: Upload duckdb
uses: actions/upload-artifact@v2
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
if: ${{ success() }}