Skip to content

Commit

Permalink
Merge pull request #8 from luffyofproduct/add-post-merge-workflow
Browse files Browse the repository at this point in the history
Add Post-Merge Deploy Workflow Automation (Production)
  • Loading branch information
luffyofproduct authored Apr 29, 2024
2 parents ec6359b + adf398e commit d4b5572
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/post_merge_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Post Merge Deploy (Production)

on:
pull_request:
types:
- closed

workflow_dispatch:

jobs:
build-and-deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
DBT_USER: ${{ secrets.DBT_USER }}
DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_PORT: ${{ secrets.DATABASE_PORT }}

steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dbt
run: pip install dbt-postgres

- name: Install dbt Packages
run: dbt deps

- name: Deploy & Test Models (Prod)
run: >
dbt build
--profiles-dir _project_docs/automation
--target prod

0 comments on commit d4b5572

Please sign in to comment.