DEV Community

Cover image for Prefect CLI Action
Panagiotis Simakis
Panagiotis Simakis

Posted on

Prefect CLI Action

My Workflow

A GitHub Action for running Prefect commands using the Prefect CLI.

Submission Category:

DIY Deployments

Yaml File or Link to Code

GitHub logo sp1thas / prefect-cli-action

Github Action for running Prefect commands using the Prefect CLI

Prefect CLI Github Action

GitHub Action for running Prefect commands using the Prefect CLI.

It requires that the checkout and setup-python actions be used first.

Inputs

  • api-key (Required): A Prefect Cloud API key
  • command (Required): The prefect command
  • prefect-version (Optional): Version of prefect to use
  • requirements-files (Optional): Path(s) to requirements files that should be installed to properly configure third-party imports

Outputs

  • prefect-command: Output of the prefect command

Example usage

name: Register prefect flow
on:
  - push

jobs:
  register-using-flow-path:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Perform prefect login
        uses: sp1thas/prefect-cli-action@main
        with:
          command: prefect auth login --key ${{ secrets.PREFECT_APIKEY }}
      - name: Register prefect flow
        uses: sp1thas/prefect-cli-action@main
        with:
          command: prefect register --project test -p flows/flow.py
Enter fullscreen mode Exit fullscreen mode



Additional Resources / Info

This Github Actions allows you to specify Prefect version or any other additional dependencies by specifying a requirements.txt file with the extra dependencies.

Top comments (0)