Skip to content

Commit

Permalink
add docs action
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-weber-artemis committed Apr 18, 2024
1 parent 6916318 commit 016c67c
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docs.yml
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'

0 comments on commit 016c67c

Please sign in to comment.