Build an Image and Deploy a Prefect flow #28
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
name: Build an Image and Deploy a Prefect flow | |
on: workflow_dispatch | |
jobs: | |
deploy_flow: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Login to GAR | |
uses: docker/login-action@v3 | |
with: | |
registry: us-east1-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Prefect Auth | |
uses: PrefectHQ/actions-prefect-auth@v1 | |
with: | |
prefect-api-key: ${{ secrets.PREFECT_API_KEY }} | |
prefect-workspace: ${{ secrets.PREFECT_WORKSPACE }} | |
# - name: Install Poetry | |
# uses: snok/install-poetry@v1 | |
# with: | |
# virtualenvs-create: true | |
# virtualenvs-in-project: true | |
# installer-parallel: true | |
# - name: Load cached venv | |
# id: cached-poetry-dependencies | |
# uses: actions/cache@v3 | |
# with: | |
# path: .venv | |
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
# - name: Install dependencies | |
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
# run: poetry install --no-interaction --no-root | |
# - name: Install library | |
# run: poetry install --no-interaction | |
# - name: Deploy with Prefect | |
# run: | | |
# prefect --no-prompt deploy --prefect-file "./prefect.yaml" --name "trigger-dbt-deploy" | |
- name: Authenticate DBT Core | |
run: 'echo "$KEYFILE" > ./dbt-service-account.json' | |
shell: bash | |
env: | |
KEYFILE: ${{ secrets.DBT_BIGQUERY_KEYFILE }} | |
- name: Run Prefect Deploy | |
uses: PrefectHQ/actions-prefect-deploy@v3 | |
with: | |
deployment-names: trigger-dbt-deploy | |
requirements-file-paths: './flows/trigger-dbt/requirements.txt' | |
deployment-file-path: './prefect.yaml' |