Skip to content

Commit

Permalink
dbt docs public #1
Browse files Browse the repository at this point in the history
  • Loading branch information
laysabit committed Feb 26, 2024
1 parent e5de09e commit ec1bc1b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test_public_dbt_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI test package

on:
push:
branches:
- ci-lint

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8

- name: Checkout Repository
uses: actions/checkout@v2

- name: Install dependencies
run: pip install -r requirements.txt

- name: Authenticate to GCP
uses: 'google-github-actions/auth@v2'
with:
credentials_json: "${{ secrets.CREDS_TEST_HUBBLE }}"

- name: Set up dbt profile
run: |
. ci_profiles.sh test test_crypto_stellar test-hubble-319619
- name: Generate dbt docs
run: dbt docs generate

- name: Copy docs to GCP bucket
run: |
gsutil cp -n ${{ github.workspace }}/target/index.html gs://dbt-docs-website
gsutil cp -n ${{ github.workspace }}/target/catalog.json gs://dbt-docs-website
gsutil cp -n ${{ github.workspace }}/target/manifest.json gs://dbt-docs-website
gsutil cp -n ${{ github.workspace }}/target/run_results.json gs://dbt-docs-website
26 changes: 26 additions & 0 deletions ci_profiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -e

echo "writing file profiles.yml"
mkdir ~/.dbt

echo "stellar_dbt:" >> ~/.dbt/profiles.yml
echo " target: $1" >> ~/.dbt/profiles.yml
echo " outputs:" >> ~/.dbt/profiles.yml
echo " $1:" >> ~/.dbt/profiles.yml
echo " dataset: $2" >> ~/.dbt/profiles.yml
echo " maximum_bytes_billed: 1000000000000" >> ~/.dbt/profiles.yml
echo " job_execution_timeout_seconds: 300" >> ~/.dbt/profiles.yml
echo " job_retries: 1" >> ~/.dbt/profiles.yml
echo " location: us" >> ~/.dbt/profiles.yml
echo " priority: interactive" >> ~/.dbt/profiles.yml
echo " project: $3" >> ~/.dbt/profiles.yml
echo " threads: 1" >> ~/.dbt/profiles.yml
echo " type: bigquery" >> ~/.dbt/profiles.yml
echo " method: oauth" >> ~/.dbt/profiles.yml

dbt deps

echo "starting dbt docs generate"
dbt docs generate --profiles-dir ~/.dbt

0 comments on commit ec1bc1b

Please sign in to comment.