Skip to content

Commit 7fec544

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 7fec544

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

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

Lines changed: 21 additions & 4 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:
@@ -29,12 +39,19 @@ jobs:
2939
- name: Install dependencies
3040
run: pnpm install
3141

32-
- name: add environment variable
42+
- name: Set environment variables
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)