forked from emilieschario/jaffle_shop
-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (41 loc) · 1.54 KB
/
prod_job.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
name: dbt production job
on:
push:
branches:
- master
env:
#TODO(developer): update PROJECT_ID
PROJECT_ID: "dbt-demo-386220"
DBT_PROFILES_DIR: ./
GOOGLE_APPLICATION_CREDENTIALS: ./service_account.json
jobs:
run:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: install requirements
run: pip install -q -r requirements.txt
- name: install datafold-sdk
run: pip install -q datafold-sdk
- name: Authenticate dbt to BigQuery
run: 'echo "$KEYFILE" > ./service_account.json' # persist file in root dir
shell: bash
env:
KEYFILE: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} # TODO: add a github secret
- name: dbt deps
run: dbt deps
- name: Generate dbt production manifest
run: dbt ls # TODO: update to dbt build after this initial run
# TODO: update the --config-id to your config id
- name: submit artifacts to datafold
run: |
set -ex
datafold dbt upload --ci-config-id 272 --run-type ${DATAFOLD_RUN_TYPE} --commit-sha ${GIT_SHA}
env:
DATAFOLD_APIKEY: ${{ secrets.DATAFOLD_APIKEY }}
DATAFOLD_RUN_TYPE: "${{ github.ref == 'refs/heads/master' && 'production' || 'pull_request' }}"
GIT_SHA: "${{ github.ref == 'refs/heads/master' && github.sha || github.event.pull_request.head.sha }}" # TODO: update refs/heads/master for your main branch name