generated from dpguthrie/snowflake-dbt-demo-project
-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (29 loc) · 1.02 KB
/
run_job_on_merge.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
# This action will trigger an already created job on dbt Cloud
# The important settings for the job include:
# - defer - defer this job to itself (will always refer to the most recently modified version of production)
# - commands - ensure you're using the state:modified+ selector to only run what's been modified
# since the last successful run for the job you're deferring to
name: Run Job on Merge
on:
push:
branches:
- main
jobs:
run_on_merge:
runs-on: ubuntu-latest
env:
DBT_CLOUD_SERVICE_TOKEN: ${{ secrets.DBT_CLOUD_SERVICE_TOKEN }}
DBT_CLOUD_ACCOUNT_ID: 43786
JOB_ID: 384691
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9.x"
- name: Run Merge Job
run: |
pip install dbtc==0.5.3
run=$(dbtc trigger-job \
--job-id=$JOB_ID \
--payload='{"cause": "Merging code to main"}')
echo "RUN_ID=$(echo $run | jq '.data.id')" >> $GITHUB_ENV