Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all-deployments input to pass the --all param for deployments #25

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ Additionally, the `prefect deploy` command needs to load your flow in order to g

| Input | Desription | Required |
|-------|------------|----------|
| deployment-names | Comma separated list of deployment names defined in the prefect.yaml file. | true |
| deployment-names | Comma separated list of deployment names defined in the prefect.yaml file. | false |
| requirements-file-paths | Comma sepearated list of paths to requirements files to correctly install dependencies for your Prefect flow(s). | false |
| all-deployments | If set to "true", all deployments defined in prefect.yaml will be deployed. This will override the deployment-names input. Defaults to "false" | true |

## Examples

Expand Down
19 changes: 15 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ inputs:
example './flow1/requirements.txt,./flow2/requirements.txt'
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
Expand All @@ -45,8 +51,13 @@ runs:
echo "The currently installed Prefect version (2.$PREFECT_SHORT_VERSION) will be updated to the latest to ensure compatibility with this action."
pip install prefect -U "prefect>=2.10.14"
fi
IFS=',' read -ra deployment_names <<< "${{ inputs.deployment-names }}"
for name in "${deployment_names[@]}"; do
prefect --no-prompt deploy --name "$name"
done
if [ ${{ inputs.all-deployments }} == "true" ];
then
prefect --no-prompt deploy --all
else
IFS=',' read -ra deployment_names <<< "${{ inputs.deployment-names }}"
for name in "${deployment_names[@]}"; do
prefect --no-prompt deploy --name "$name"
done
fi
shell: bash