mirror of
https://github.com/FlipsideCrypto/analytics-workflow-templates.git
synced 2026-02-06 11:17:52 +00:00
added the doc generate script
This commit is contained in:
parent
81c6d76e38
commit
25fcc964ab
63
.github/workflows/dbt_docs_updates.yml
vendored
Normal file
63
.github/workflows/dbt_docs_updates.yml
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
name: docs_update
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
env:
|
||||
ACCOUNT: "${{ secrets.ACCOUNT }}"
|
||||
ROLE: "${{ secrets.ROLE }}"
|
||||
USER: "${{ secrets.USER }}"
|
||||
PASSWORD: "${{ secrets.PASSWORD }}"
|
||||
REGION: "${{ secrets.REGION }}"
|
||||
DATABASE_DEV: "${{ secrets.DATABASE_DEV }}"
|
||||
DATABASE_PROD: "${{ secrets.DATABASE_PROD }}"
|
||||
WAREHOUSE_DEV: "${{ secrets.WAREHOUSE_DEV }}"
|
||||
WAREHOUSE_PROD: "${{ secrets.WAREHOUSE_PROD }}"
|
||||
|
||||
jobs:
|
||||
scheduled_run:
|
||||
name: docs_update
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: "3.7.x"
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip install dbt-snowflake
|
||||
dbt deps
|
||||
- name: delete existing docs branch
|
||||
run: git push origin --delete docs || true
|
||||
|
||||
- name: checkout docs branch
|
||||
run: |
|
||||
git checkout -b docs
|
||||
git push --set-upstream origin docs
|
||||
- name: generate dbt docs
|
||||
run: dbt docs generate -t prod --profiles-dir ./.dbt
|
||||
|
||||
- name: move files to docs directory
|
||||
run: |
|
||||
mkdir -p ./docs
|
||||
cp target/{catalog.json,manifest.json,index.html} docs/
|
||||
- name: clean up target directory
|
||||
run: dbt clean
|
||||
|
||||
- name: check for changes
|
||||
run: git status
|
||||
|
||||
- name: stage changed files
|
||||
run: git add .
|
||||
|
||||
- name: commit changed files
|
||||
run: |
|
||||
git config user.email "abc@xyz"
|
||||
git config user.name "github-actions"
|
||||
git commit -am "Auto-update docs"
|
||||
- name: push changes to docs
|
||||
run: |
|
||||
git push
|
||||
Loading…
Reference in New Issue
Block a user