Auto-gen docs to separate branch (#22)

* 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

* Auto-update docs

* docs branch

* docs branch

* docs branch

* manual -b

* checkout main first

* upstream

* set upstream later

* ok now if theres a change

* or

* git

* fetch

* new branch success, what about existing branch

* ff only

* conditional git

* del and create new docs branch

* true

* true elsewhere

* del docs dir

Co-authored-by: github-actions <abc@xyz>
This commit is contained in:
Jack Forgash 2022-05-25 09:25:04 -06:00 committed by GitHub
parent f7fe080eef
commit 352f4f25f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: check out main
uses: actions/checkout@main
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
with:
@ -34,10 +33,18 @@ jobs:
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 --profiles-dir ./.dbt
- name: move to docs directory
- name: move files to docs directory
run: |
mkdir -p ./docs
cp target/{catalog.json,manifest.json,index.html} docs/
@ -56,7 +63,7 @@ jobs:
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
- name: push changes to docs
run: |
git push