-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathaction.yaml
More file actions
86 lines (76 loc) · 2.4 KB
/
action.yaml
File metadata and controls
86 lines (76 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Deploy a Prefect flow
author: PrefectHQ
description: Deploy a flow from a project by creating a Prefect deployment.
branding:
icon: upload-cloud
color: blue
inputs:
deployment-names:
description:
Comma separated list of names of your
Prefect deployments.
example 'deployment1,deployment2'
required: false
default: deployment
requirements-file-paths:
description:
Comma separated list of paths to
requirements files to correctly install
dependencies for your Prefect flow(s).
example './flow1/requirements.txt,./flow2/requirements.txt'
required: false
default: ''
deployment-file-path:
description:
Relative path to your Prefect deployment file.
example './prefect-deployment-files/prefect.yaml'
required: false
default: './prefect.yaml'
pyproject-toml-path:
description:
Path to your pyproject.toml file for
dependency management of your Prefect flow(s).
example './pyproject.toml'
required: false
default: ''
all-deployments:
description:
If set to true, all deployments will be
deployed. This will override the
deployment-names input.
default: "false"
runs:
using: composite
steps:
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up environment
run: uv venv --clear
shell: bash
- id: install-local-requirements
if: ${{ inputs.requirements-file-paths != '' }}
run: |
IFS=',' read -ra requirements_paths <<< "${{ inputs.requirements-file-paths }}"
for req in ${requirements_paths[@]}; do
uv pip install -r $req
done
shell: bash
- id: install-from-pyproject-toml
if: ${{ inputs.pyproject-toml-path != '' }}
run: |
cd $(dirname ${{ inputs.pyproject-toml-path }})
uv pip install .
shell: bash
- id: prefect-deploy
run: |
uv pip install prefect -U "prefect>=3,<4"
if [ ${{ inputs.all-deployments }} == "true" ];
then
uv run prefect --no-prompt deploy --all --prefect-file "${{ inputs.deployment-file-path }}"
else
IFS=',' read -ra deployment_names <<< "${{ inputs.deployment-names }}"
for name in "${deployment_names[@]}"; do
uv run prefect --no-prompt deploy --prefect-file "${{ inputs.deployment-file-path }}" --name "$name"
done
fi
shell: bash