Skip to content

Commit f8c5bd6

Browse files
committed
cicd: add manual workflow dispatch for CI/CD pipeline
1 parent c7ab4cf commit f8c5bd6

3 files changed

Lines changed: 51 additions & 6 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,43 @@ on:
66
- dev
77
release:
88
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
environment:
12+
description: 'Deployment environment'
13+
required: true
14+
default: 'dev'
15+
type: choice
16+
options:
17+
- dev
18+
- prod
19+
wordpress_version:
20+
description: 'WordPress version (leave empty to use wp-version-control.cfg)'
21+
required: false
22+
type: string
923

1024
jobs:
1125
deploy:
1226
runs-on: ubuntu-latest
1327
env:
14-
TARGET_PATH: ${{ github.eventname == 'push' && secrets.SERVER_DEV_TARGET_PATH || secrets.SERVER_PROD_TARGET_PATH }}
28+
TARGET_PATH: ${{
29+
github.event_name == 'workflow_dispatch' &&
30+
(github.event.inputs.environment == 'prod' && secrets.SERVER_PROD_TARGET_PATH || secrets.SERVER_DEV_TARGET_PATH) ||
31+
(github.event_name == 'push' && secrets.SERVER_DEV_TARGET_PATH || secrets.SERVER_PROD_TARGET_PATH) }}
1532

1633
steps:
1734
- name: Checkout
1835
uses: actions/checkout@master
1936

2037
- name: Prepare WordPress Zip
2138
run: |
22-
WP_LINK=$(cat wp-version-control.cfg)
39+
if [ "${{ github.event.inputs.wordpress_version }}" != "" ]; then
40+
echo "Using custom WordPress version: ${{ github.event.inputs.wordpress_version }}"
41+
WP_LINK="https://wordpress.org/wordpress-${{ github.event.inputs.wordpress_version }}.zip"
42+
else
43+
echo "Using WordPress version from wp-version-control.cfg"
44+
WP_LINK=$(cat wp-version-control.cfg)
45+
fi
2346
wget -O "./wordpress.zip" $WP_LINK
2447
2548
- name: Prepare plugins and themes

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,19 @@ This ensures consistent WordPress versions across deployments.
162162

163163
### Trigger Events
164164

165-
- **Development Deployment**: Push to `dev` branch
166-
- **Production Deployment**: Create a release
165+
- **Automatic Development Deployment**: Push to `dev` branch
166+
- **Automatic Production Deployment**: Create a release
167+
- **Manual Deployment**: Through GitHub Actions web interface with environment and WordPress version selection
168+
169+
#### Manual Deployment
170+
171+
1. Go to your GitHub repository
172+
2. Open the **Actions** tab
173+
3. Select the **GameStore Deploy** workflow
174+
4. Click **Run workflow**
175+
5. Configure parameters:
176+
- **Environment**: `dev` or `prod`
177+
- **WordPress version**: leave empty to use version from `wp-version-control.cfg` or specify exact version (e.g., `6.3.2`)
167178

168179
### Deployment Stages
169180

docs/ru/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,19 @@ https://wordpress.org/latest.zip
162162

163163
### События запуска
164164

165-
- **Деплой разработки**: Push в ветку `dev`
166-
- **Продакшн деплой**: Создание релиза
165+
- **Автоматический деплой разработки**: Push в ветку `dev`
166+
- **Автоматический продакшн деплой**: Создание релиза
167+
- **Ручной деплой**: Через веб-интерфейс GitHub Actions с выбором окружения и версии WordPress
168+
169+
#### Ручной запуск деплоя
170+
171+
1. Перейдите в ваш репозиторий GitHub
172+
2. Откройте вкладку **Actions**
173+
3. Выберите workflow **GameStore Deploy**
174+
4. Нажмите **Run workflow**
175+
5. Выберите параметры:
176+
- **Environment**: `dev` или `prod`
177+
- **WordPress version**: оставьте пустым для использования версии из `wp-version-control.cfg` или укажите конкретную версию (например, `6.3.2`)
167178

168179
### Этапы деплоя
169180

0 commit comments

Comments
 (0)