-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (47 loc) · 1.63 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: docs
on:
push:
branches: main
env:
SYSTEM_SNOWFLAKE_USER: ${{ secrets.SYSTEM_SNOWFLAKE_USER }}
SYSTEM_SNOWFLAKE_PASSWORD: ${{ secrets.SYSTEM_SNOWFLAKE_PASSWORD }}
SYSTEM_SNOWFLAKE_ROLE: ${{ secrets.SYSTEM_SNOWFLAKE_ROLE }}
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:
python-version: '3.11'
- 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: Init dbt
uses: ./.github/actions/init-dbt
- 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" "target/partial_parse.msgpack" 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'