-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (112 loc) · 3.78 KB
/
ci.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Providence
# CI Workflow
#
name: Providence CI
on:
push:
branches-ignore:
# temporary branches created by pipeline github Integration to run tasks on github actions
- "workflow-*"
env:
CONTAINER_REGISTRY: ghcr.io
PYTHON_VERSION: 3.10.6
# add permissions needed to push containers to GHCR with GITHUB_TOKEN & test
# pipelines github integration.
permissions:
actions: write
contents: write
packages: write
jobs:
dbt-transform:
name: "DBT Transform"
runs-on: ubuntu-22.04
env:
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_APP_KEY: ${{ secrets.B2_APP_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Setup dependencies
run: make deps-dbt
- name: Lint
run: make lint-dbt
- name: Build
run: make build-dbt
dbt-docs:
name: "DBT Docs"
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Setup dependencies
run: make deps-dbt
- name: Generate docs
env:
DBT_TARGET: prod
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_APP_KEY: ${{ secrets.B2_APP_KEY }}
motherduck_token: ${{ secrets.motherduck_token }}
working-directory: transforms/dbt
run: |
set -ex -o pipefail
# generate docs into 'target' dir
dbt docs generate
# create 'docs' dir containing only the files needed for dbt docs
mkdir docs
cp target/{index.html,manifest.json,catalog.json} -t docs
- name: Publish docs
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: transforms/dbt/docs
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
full_commit_message: "doc(transform): update dbt docs for ${{ github.sha }}"
pipelines:
name: "Pipelines: Lint, Test & Publish"
runs-on: ubuntu-22.04
env:
PVD_LAKE_BUCKET: mrzzy-co-data-lake
YNAB_BUDGET_ID: f3f15316-e48c-4235-8d5d-1aa3191b3b8c
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python
env:
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_APP_KEY: ${{ secrets.B2_APP_KEY }}
SIMPLYGO_SRC_USERNAME: ${{ secrets.SIMPLYGO_SRC_USERNAME }}
SIMPLYGO_SRC_PASSWORD: ${{ secrets.SIMPLYGO_SRC_PASSWORD }}
YNAB_ACCESS_TOKEN: ${{ secrets.YNAB_ACCESS_TOKEN }}
# hack to workaround: https://github.com/PrefectHQ/prefect/issues/13349
# by directing prefect to retrieve blocks from prefect cloud instead.
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
motherduck_token: ${{ secrets.motherduck_token }}
with:
make-suffix: pipelines
python-version: "${{ env.PYTHON_VERSION }}"
- name: Publish Container
uses: ./.github/actions/ghcr
with:
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
name: "pvd-pipeline"
dockerfile: "infra/Dockerfile.pipeline"
- name: Authenticate with Prefect Cloud
uses: PrefectHQ/actions-prefect-auth@v1
with:
prefect-api-key: ${{ secrets.PREFECT_API_KEY }}
prefect-workspace: mrzzy/default
- name: Deploy Pipelines
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: pipelines
env:
PREFECT_WORK_POOL: azure-container-instances
run: python deploy.py