Skip to content

Commit 5f664dc

Browse files
author
Student
committed
add post merge deploy file
1 parent 184c785 commit 5f664dc

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Post Merge Deploy (Production)
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-deploy:
12+
if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
env:
15+
DBT_USER: ${{ secrets.DBT_USER }}
16+
DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}
17+
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
18+
DATABASE_PORT: ${{ secrets.DATABASE_PORT }}
19+
20+
steps:
21+
- name: Checkout branch
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.9'
28+
29+
- name: Install dbt
30+
run: pip install dbt-core==1.8.7 dbt-postgres==1.8.2
31+
32+
- name: Install dbt Packages
33+
run: dbt deps
34+
35+
- name: Deploy & Test Models (Prod)
36+
run: >
37+
dbt build
38+
--profiles-dir _project_docs/automation
39+
--target prod
40+

0 commit comments

Comments
 (0)