-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from OHDSI/lawrenceadams-add-docs-ci
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
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 |