Skip to content

Commit

Permalink
Merge pull request #3 from segoldma/feat/persist-manifest
Browse files Browse the repository at this point in the history
update action using env vars
  • Loading branch information
segoldma authored Aug 3, 2024
2 parents 7b2b55a + dbe132c commit 2516dc6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .ci/profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sethbox:
target: ci
outputs:
ci:
dataset: "{{ env_var('CICD_DATASET') }}"
keyfile: "{{ env_var('CICD_SERVICE_ACCOUNT') }}"
location: "{{ env_var('CICD_LOCATION') }}"
priority: "{{ env_var('CICD_PRIORITY') }}"
project: "{{ env_var('CICD_PROJECT') }}"
type: bigquery
method: service-account
job_execution_timeout_seconds: 300
job_retries: 1
threads: 16

28 changes: 25 additions & 3 deletions .github/workflows/persist-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,34 @@ jobs:

- name: Install dbt
run: |
pip install dbt-core
pip install dbt-bigquery
- name: Set up environment variables
env:
CICD_DATASET: ${{ secrets.CICD_DATASET }}
CICD_SERVICE_ACCOUNT: /tmp/service_account.json
CICD_LOCATION: ${{ secrets.CICD_LOCATION }}
CICD_PRIORITY: ${{ secrets.CICD_PRIORITY }}
CICD_PROJECT: ${{ secrets.CICD_PROJECT }}
run: |
echo "${{ secrets.CICD_SERVICE_ACCOUNT }}" > /tmp/service_account.json
- name: Create dbt profiles directory
run: mkdir -p ~/.dbt

- name: Copy profiles.yml to dbt directory
run: cp .ci/profiles.yml ~/.dbt/profiles.yml

- name: Run dbt to generate manifest
env:
CICD_DATASET: ${{ secrets.CICD_DATASET }}
CICD_SERVICE_ACCOUNT: /tmp/service_account.json
CICD_LOCATION: ${{ secrets.CICD_LOCATION }}
CICD_PRIORITY: ${{ secrets.CICD_PRIORITY }}
CICD_PROJECT: ${{ secrets.CICD_PROJECT }}
run: |
dbt deps
dbt compile
dbt deps --profiles-dir ~/.dbt
dbt compile --profiles-dir ~/.dbt
- name: Checkout manifests branch
run: |
Expand Down

0 comments on commit 2516dc6

Please sign in to comment.