Skip to content

Commit f3afc08

Browse files
Allison dbt docs workflow (#129)
2 parents f8b0f6f + 3315048 commit f3afc08

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/generate_docs.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Generate DBT Docs
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
# allows manual running
7+
workflow_dispatch:
8+
9+
jobs:
10+
generate:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Install dbt
20+
run: python -m pip install dbt-core dbt-redshift
21+
22+
- name: Set up dbt profile
23+
run: |
24+
mkdir -p ~/.dbt
25+
echo "
26+
cdo_redshift:
27+
target: dev
28+
outputs:
29+
dev:
30+
type: redshift
31+
host: \"${{ secrets.DBT_HOST }}\"
32+
user: \"${{ secrets.DBT_USER }}\"
33+
password: \"${{ secrets.DBT_PASSWORD }}\"
34+
port: 5439
35+
dbname: dev
36+
schema: \"${{ secrets.DBT_DB_SCHEMA }}\"
37+
sslmode: disable
38+
threads: 16
39+
ra3_node: true # see https://github.com/dbt-labs/dbt-redshift/issues/281#issuecomment-1407131697
40+
" > ~/.dbt/profiles.yml
41+
42+
- name: Install dbt dependencies
43+
working-directory: ./dbt
44+
run: dbt deps
45+
46+
- name: Generate dbt docs
47+
working-directory: ./dbt
48+
run: dbt docs generate
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./dbt/target
54+
55+
deploy:
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
needs: generate
60+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
61+
permissions:
62+
pages: write # to deploy to Pages
63+
id-token: write # to verify the deployment originates from an appropriate source
64+
runs-on: ubuntu-latest
65+
name: Deploy
66+
steps:
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)