Skip to content

Commit 3aa0f71

Browse files
committed
ci(deploy): add workflow dispatch for environment selection
- Introduced a workflow dispatch input to allow manual triggering of the deployment with an environment choice (alpha or production). - Updated the environment variable setup to reflect the selected environment, ensuring the correct VITE_ORIGIN_URL is used during deployment.
1 parent 97a5bfd commit 3aa0f71

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/deploy-gh-pages.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [develop]
6+
workflow_dispatch:
7+
inputs:
8+
environment:
9+
description: 'Backend environment'
10+
required: true
11+
default: 'alpha'
12+
type: choice
13+
options:
14+
- alpha
15+
- production
616

717
jobs:
818
deploy-gh-pages:
@@ -31,10 +41,17 @@ jobs:
3141

3242
- name: add environment variable
3343
run: |
34-
cat <<'EOF' >> designer-demo/env/.env.alpha
35-
// ---- appended by CI (gh-pages) ----
36-
VITE_ORIGIN=https://agent.opentiny.design/
44+
ENV=${{ github.event.inputs.environment || 'alpha' }}
45+
VITE_ORIGIN_URL="https://agent-alpha.opentiny.design/"
46+
if [ "$ENV" = "production" ]; then
47+
VITE_ORIGIN_URL="https://agent.opentiny.design/"
48+
fi
49+
cat <<EOF >> designer-demo/env/.env.alpha
50+
# ---- appended by CI (gh-pages) ----
51+
VITE_ORIGIN=$VITE_ORIGIN_URL
3752
EOF
53+
echo "DEPLOY_ENV=$ENV"
54+
echo "VITE_ORIGIN_URL=$VITE_ORIGIN_URL"
3855
- name: Run Build
3956
run: |
4057
set -eo pipefail

0 commit comments

Comments
 (0)