-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6916318
commit 016c67c
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: docs | ||
on: | ||
push: | ||
branches: main | ||
jobs: | ||
write-dbt-to-pages-repo: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
cache: 'pip' | ||
cache-dependency-path: 'dev-requirements.txt' | ||
|
||
- name: Generate a Github App token | ||
id: generate_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.ARTEMIS_CI_APP_ID }} | ||
private-key: ${{ secrets.ARTEMIS_CI_APP_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
repositories: "artemis-xyz.github.io" | ||
|
||
- name: Set up dependencies | ||
run: | | ||
pip install pip==23.1.2 | ||
pip install pip-tools==6.13.0 | ||
pip-sync dev-requirements.txt | ||
- name: Generate docs | ||
run: | | ||
dbt deps | ||
dbt docs generate --threads 16 | ||
git diff | ||
mkdir generated_dbt_docs | ||
mv "target/index.html" "target/manifest.json" "target/catalog.json" generated_dbt_docs | ||
- name: Push to Github Pages repo | ||
uses: cpina/[email protected] | ||
env: | ||
API_TOKEN_GITHUB: ${{ steps.generate_token.outputs.token }} | ||
with: | ||
source-directory: 'generated_dbt_docs' | ||
target-directory: 'dbt' | ||
destination-github-username: 'artemis-xyz' | ||
destination-repository-name: 'artemis-xyz.github.io' | ||
user-name: 'Artemis CI' | ||
commit-message: 'update DBT docs' |