-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy dbt docs to GitHub Pages (#57)
- Loading branch information
1 parent
f617f52
commit 042c2a7
Showing
2 changed files
with
63 additions
and
3 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,60 @@ | ||
name: deploy-dbt-docs | ||
|
||
on: | ||
workflow_run: | ||
workflows: [build-and-test-dbt] | ||
branches: [master, data-catalog] | ||
types: [completed] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-dbt-docs: | ||
runs-on: ubuntu-latest | ||
# 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: Install dbt requirements | ||
uses: ./.github/actions/install_dbt_requirements | ||
|
||
- name: Load environment variables | ||
uses: ./.github/actions/load_environment_variables | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }} | ||
aws-region: us-east-1 | ||
|
||
- name: Generate docs | ||
# Target is currently set to CI because we expect this action to be | ||
# run against the long-lived data-catalog branch, but we should change | ||
# this to prod when we merge that branch into master | ||
run: dbt docs generate --target ci | ||
working-directory: ${{ env.PROJECT_DIR }} | ||
shell: bash | ||
env: | ||
HEAD_REF: data-catalog | ||
|
||
- name: Package doc files for upload | ||
run: | | ||
mkdir _site | ||
for file in index.html catalog.json manifest.json; do | ||
cp "target/$file" "_site/$file" | ||
done | ||
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 |
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