11232567964 generate docs #12
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
name: Generate DBT Docs | |
run-name: ${{ github.run_id }} generate docs | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: install dbt-deps | |
run: | | |
cd dbt_app | |
dbt deps | |
- name: Write dbt profile to file | |
run: | | |
mkdir -p ~/.dbt | |
echo "${{ secrets.SNOWFLAKE_DBT_PROFILE }}" > ~/.dbt/profiles.yml | |
- name: Generate documentation | |
run: | | |
cd dbt_app/; dbt docs generate --static; mv ./target/static_index.html ../docs/index.html | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "guillaume.gonde@theodo.com" | |
git config --global user.name "GuillaumeGSicara_GithubWorkflow" | |
git add ../docs/index.html | |
git commit -m "Github Workflow Generate DBT docs" | |
git push https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/GuillaumeGSicara/dbt-snowflake-cortex.git |