Last active
August 21, 2021 08:49
-
-
Save tuanchris/4092e188d79707d65bfaaebdaf9b6e2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pr_to_main | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
DBT_PROFILES_DIR: ./ | |
DBT_GOOGLE_PROJECT_DEV: ${{ secrets.DBT_GOOGLE_PROJECT_DEV }} | |
DBT_GOOGLE_BIGQUERY_DATASET_DEV: ${{ secrets.DBT_GOOGLE_BIGQUERY_DATASET_DEV }} | |
# The DBT_GOOGLE_BIGQUERY_KEYFILE_DEV secret will be written to a json file below | |
DBT_GOOGLE_BIGQUERY_KEYFILE_DEV: ./dbt-service-account.json | |
jobs: | |
pr_to_main: | |
name: pr_to_main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@master | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: "3.7.x" | |
- name: Authenticate using service account | |
run: 'echo "$KEYFILE" > ./dbt-service-account.json' | |
shell: bash | |
env: | |
KEYFILE: ${{secrets.DBT_GOOGLE_BIGQUERY_KEYFILE_DEV}} | |
- name: Install dependencies | |
run: | | |
pip install dbt | |
dbt deps | |
# Add dbt seed or other commands here if needed | |
- name: Run dbt models | |
run: dbt run | |
- name: Test dbt models | |
run: dbt test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment