-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
59 lines (58 loc) · 1.87 KB
/
action.yml
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
name: Reflex Deploy Action
description: Deploy Reflex apps to Reflex Cloud.
inputs:
auth_token:
description: Reflex authentication token (stored as a secret).
required: true
project_id:
description: The ID of the Reflex project to deploy to (stored as a secret).
required: true
app_directory:
description: The subfolder containing the Reflex app (default is root).
required: false
default: "."
extra_args:
description: Additional arguments to pass to the Reflex CLI.
required: false
python_version:
description: The version of Python to use.
required: false
default: "3.9"
dry_run:
description: Whether to run the deployment in dry-run mode.
required: false
default: "false"
branding:
icon: upload-cloud
color: purple
runs:
using: "composite"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Install Reflex & Dependencies
run: |
REQUIREMENTS_FILE="${{ inputs.app_directory }}/requirements.txt"
if ! grep -q "^reflex" "$REQUIREMENTS_FILE"; then
echo "Error: 'reflex' is not listed in $REQUIREMENTS_FILE."
exit 1
fi
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
echo "Dry run enabled, skipping Reflex & Dependencies installation."
else
pip install -r "$REQUIREMENTS_FILE"
fi
shell: bash
- name: Deploy Reflex App
run: |
cd ${{ inputs.app_directory }}
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
echo "Dry run enabled, skipping reflex deployv2."
else
reflex deployv2 --token ${{ inputs.auth_token }} --project ${{ inputs.project_id }} --no-interactive ${{ inputs.extra_args }}
fi
shell: bash