Build an Image and Deploy a Prefect flow #18
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.10' | |
- 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: Run Prefect Deploy | |
uses: PrefectHQ/actions-prefect-deploy@v3 | |
with: | |
deployment-names: trigger-dbt-deploy | |
deployment-file-path: './prefect.yaml' |