flow-models/.github/workflows/docs_update.yml
Jack Forgash f7fe080eef
Automate Docs Generate (#21)
* first pass

* test 2

* test 3

* test 4

* test 5

* test 6

* test 6

* test 7

* test 8

* test 9

* test 10

* test 11

* repo token test

* token test 2

* token test 3

* token test 4

* token test 5

* Auto-update docs

* removed with on checkout test

* testing file move

* mkdir command

* no spaces

* Auto-update docs

* update gitignore for target again

* Auto-update docs

* clean target

* Auto-update docs

* will it delete user.yml

* Auto-update docs

* test profile as env

* echo echo

* space

* secretS

* nope, only encrypted

* Auto-update docs

* clean up test profile

* Auto-update docs

* pythonless test

* Auto-update docs

* del blank line

* jk keep python

Co-authored-by: github-actions <abc@xyz>
2022-05-24 18:34:03 -06:00

62 lines
1.4 KiB
YAML

name: docs_update
on:
push:
branches:
- 'main'
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:
- name: check out main
uses: actions/checkout@main
- uses: actions/setup-python@v1
with:
python-version: "3.7.x"
- name: install dependencies
run: |
pip install dbt-snowflake
dbt deps
- name: generate dbt docs
run: dbt docs generate --profiles-dir ./.dbt
- name: move 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 main
run: git push origin HEAD:main