diff --git a/.gitea/workflows/install.yaml b/.gitea/workflows/install.yaml index 26e7c34..64e56df 100644 --- a/.gitea/workflows/install.yaml +++ b/.gitea/workflows/install.yaml @@ -1,37 +1,53 @@ -name: Install MSI on Specific Runner -on: [push] +name: Manual and Auto Deployment +on: + push: + branches: [main] + # Добавляем блок ручного запуска + workflow_dispatch: + inputs: + run_mode: + description: 'Что запустить?' + required: true + default: 'all' + type: choice + options: + - 'all' + - 'docker_only' + - 'msi_only' jobs: - # Вариант 2: Параллельный запуск на конкретном списке машин (Матрица) - deploy_all: - strategy: - matrix: - target_runner: [K4012-KOA] - - runs-on: ${{ matrix.target_runner }} - steps: - - name: Install MSI and Create Log - shell: powershell - run: | - # Используем другой файл (git_MAX2.txt), как вы указали - Start-Process msiexec.exe -ArgumentList "/i C:\install\MAX.msi /qn /norestart" -Wait - "Installed successfully on $(hostname) at $(Get-Date)" | Out-File -FilePath "C:\install\git_MAX2.txt" -Encoding utf8 - # Вариант 1: Запуск только на одном (или первом свободном) self-hosted раннере - install_single: - runs-on: self-hosted - steps: - - name: Install MSI and Create Log - shell: powershell - run: | - Start-Process msiexec.exe -ArgumentList "/i C:\install\MAX.msi /qn /norestart" -Wait - "Installed successfully on $(hostname) at $(Get-Date)" | Out-File -FilePath "C:\install\git_MAX.txt" -Encoding utf8 - -#docker-latest + # 1. Работа с Docker (только если выбрано 'all' или 'docker_only') docker-latest: + if: github.event_name == 'push' || github.event.inputs.run_mode == 'all' || github.event.inputs.run_mode == 'docker_only' runs-on: docker-latest container: image: node:18-alpine steps: - name: docker ps shell: bash - run: docker ps \ No newline at end of file + run: docker ps + + # 2. Установка MSI на конкретный раннер + deploy_all: + if: github.event_name == 'push' || github.event.inputs.run_mode == 'all' || github.event.inputs.run_mode == 'msi_only' + strategy: + matrix: + target_runner: [K4012-KOA] + runs-on: ${{ matrix.target_runner }} + steps: + - name: Install MSI and Create Log + shell: powershell + run: | + Start-Process msiexec.exe -ArgumentList "/i C:\install\MAX.msi /qn /norestart" -Wait + "Installed successfully on $(hostname) at $(Get-Date)" | Out-File -FilePath "C:\install\git_MAX2.txt" -Encoding utf8 + + # 3. Установка на любой свободный self-hosted + install_single: + if: github.event_name == 'push' || github.event.inputs.run_mode == 'all' || github.event.inputs.run_mode == 'msi_only' + runs-on: self-hosted + steps: + - name: Install MSI and Create Log + shell: powershell + run: | + Start-Process msiexec.exe -ArgumentList "/i C:\install\MAX.msi /qn /norestart" -Wait + "Installed successfully on $(hostname) at $(Get-Date)" | Out-File -FilePath "C:\install\git_MAX.txt" -Encoding utf8 \ No newline at end of file