Skip to content
cloud

GitHub Action

prefect-cli

0.2 Latest version

prefect-cli

cloud

prefect-cli

Run prefect commands on a Python project

Installation

Copy and paste the following snippet into your .yml file.

              

- name: prefect-cli

uses: sp1thas/[email protected]

Learn more about this action in sp1thas/prefect-cli-action

Choose a version

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