generated from brabster/dbt_bigquery_template
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 1.84 KB
/
deploy.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
67
68
69
name: deploy-to-gcp
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
schedule:
- cron: '0 4 * * SAT'
jobs:
deploy:
runs-on: ubuntu-latest
env:
PIP_REQUIRE_VIRTUALENV: true
DBT_PYPI_EARLIEST_DOWNLOAD_DATE: ${{ vars.DBT_PYPI_EARLIEST_DOWNLOAD_DATE }}
DBT_MAX_GIGABYTES_BILLED: ${{ vars.DBT_MAX_GIGABYTES_BILLED }}
permissions:
contents: read
id-token: write
actions: read
pages: write
steps:
- uses: actions/checkout@v4
- name: setup dbt
uses: ./.github/actions/setup_dbt
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
- name: ensure prod dataset exists
uses: ./.github/actions/dbt_command
with:
env: prod
command: dbt run-operation ensure_datasets
- name: load prod safety db
run: |
source .venv/bin/activate
source .envs/prod/.env
python etl/safety_db/load_missing_partitions.py --dataset ${DBT_DATASET}_internal
- name: dbt prod build
uses: ./.github/actions/dbt_build
with:
env: prod
- name: dbt prod cleanup
uses: ./.github/actions/dbt_command
with:
env: prod
command: "dbt run-operation cleanup --args '{dry_run: False}'"
- name: dbt prod contracts
uses: ./.github/actions/dbt_contract_test
with:
env: prod
- name: upload prod pages
uses: actions/upload-pages-artifact@v3
with:
path: target
- name: deploy prod pages
uses: actions/deploy-pages@v4