-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from segoldma/feat/persist-manifest
Add persist manifest gha
- Loading branch information
Showing
1 changed file
with
49 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,49 @@ | ||
name: Persist dbt Manifest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
persist_manifest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout main branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dbt | ||
run: | | ||
pip install dbt-core | ||
- name: Run dbt to generate manifest | ||
run: | | ||
dbt deps | ||
dbt compile | ||
- name: Checkout manifests branch | ||
run: | | ||
git fetch origin | ||
git checkout -b manifests origin/manifests || git checkout manifests | ||
- name: Copy new manifest | ||
run: | | ||
cp target/manifest.json manifests/previous_manifest.json | ||
- name: Commit and push changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add manifests/previous_manifest.json | ||
git commit -m "Update previous manifest" | ||
git push origin manifests |