-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (56 loc) · 1.91 KB
/
deploy_dbt_docs.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: deploy-dbt-docs
on:
workflow_run:
workflows: [build-and-test-dbt]
branches: [master]
types: [completed]
workflow_dispatch:
jobs:
deploy-dbt-docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# These permissions are required to make a GitHub Pages deployment
permissions:
pages: write # To deploy to Pages
id-token: write # To verify the deployment comes from an valid source
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup dbt
uses: ./.github/actions/setup_dbt
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }}
- name: Setup node
uses: actions/setup-node@v3
- name: Install docs build dependencies
run: npm install -g @mermaid-js/mermaid-cli
- name: Prepare Mermaid assets for docs
run: |
for file in assets/*.mmd; do
mmdc -i "$file" -o "${file/.mmd/.svg}"
done
working-directory: ${{ env.PROJECT_DIR }}
shell: bash
- name: Generate docs
run: dbt docs generate --target prod
working-directory: ${{ env.PROJECT_DIR }}
shell: bash
- name: Package doc files for upload
run: |
mkdir -p _site/assets
for file in index.html catalog.json manifest.json; do
cp "target/$file" "_site/$file"
done
cp -R target/assets/* _site/assets
working-directory: ${{ env.PROJECT_DIR }}
shell: bash
- name: Upload docs directory artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ format('{0}/_site', env.PROJECT_DIR) }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2