-
Notifications
You must be signed in to change notification settings - Fork 14
51 lines (48 loc) · 1.5 KB
/
bi-refresh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: BI Refresh
on:
schedule:
- cron: '28 0 * * 1'
workflow_dispatch:
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_ORGANIZATION: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
deploy-bi:
strategy:
fail-fast: false
matrix:
environment: [prod, staging]
name: "Refresh BI (${{ matrix.environment }})"
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
COMPOSE_FILE: "docker-compose.dbt.yaml"
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: "Login to Github Docker Registry"
run: ./scripts/docker_login_github.py
- name: "Build BI image"
run: |
# Build BI image
./scripts/bi-docker-image/build_image.sh
# Verify BI image
./scripts/bi-docker-image/verify_image.sh
- name: "Set environment env variable"
run: |-
pip install django-environ
source <(python ./pola-bi/dev.py --environment "${TARGET_ENV}")
printenv | grep POLA_APP | cut -d "=" -f 2- | xargs -n 1 -I {} echo "::add-mask::{}"
printenv | grep POLA_APP >> $GITHUB_ENV;
env:
TARGET_ENV: ${{ matrix.environment }}
- run: ./run_dbt.sh dbt deps
- run: ./run_dbt.sh dbt build