matta
07/31/2021, 2:58 AMmatta
07/31/2021, 2:59 AMmatta
07/31/2021, 3:02 AMname: Feature CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ feature/* ]
pull_request:
branches: [ feature/* ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
PREFECT__CLOUD__API_KEY: ${{ secrets.PREFECT_KEY }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: upgrade pip
shell: bash -l {0}
run: pip install --upgrade pip
- name: install prefect
shell: bash -l {0}
run: pip install "prefect[google]"
- name: Register flows
shell: bash -l {0}
# Flows won't be Scheduled unless they're committed to Main
run: prefect register --no-schedule --project tester -p flows/
Jeremy Phelps
07/31/2021, 7:44 AMclass MyFlow(prefect.Flow):
def __init__(self, name, *args, **kwargs):
super().__init__(self, name, *args, storage=Docker(registry_url='...', image_name='...'), **kwargs)
self.run_config=UniversalRun(labels=staging_or_prod())
self.executor=DaskExecutor(...)