Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add workflow to generate DBT documentation and deploy to GitHub Pages #73

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Generate DBT Docs
on:
push:
branches:
- main
paths:
- macros/**
- models/**
- seeds/**
- snapshots/**
- tests/**
- dbt_project.yml

jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'requirements/duckdb.txt'
- name: Install dependencies
run: |
pip install -r requirements/duckdb.txt
- name: Setup profile
run: |
cat << EOF > profiles.yml
synthea_omop_etl:
outputs:
dev:
type: duckdb
path: synthea_omop_etl.duckdb
schema: dbt_synthea_dev
target: dev
target: dev
EOF
- run: dbt deps
- name: Generate Docs and prepare for upload
run: |
dbt docs generate
mkdir ./payload
mv ./target/index.html ./payload
mv ./target/manifest.json ./payload
mv ./target/catalog.json ./payload

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./payload

deploy:
needs: update-docs
permissions:
pages: write # to deploy to Pages
id-token: write # required for OIDC token fetch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4