feat: improve install action
Test Action / Test Base Modules Requires PHP (push) Failing after 10m29s
Test Action / Test Base Modules Installation (push) Failing after 10m31s
Test Action / Test Node (push) Failing after 10m37s
Test Action / Test Build Command (push) Failing after 14m37s
Test Action / Test Custom Server Path (push) Failing after 15m23s
Test Action / Test All Components (push) Failing after 15m25s
Test Action / Test nginx (push) Failing after 15m27s
Test Action / Test Database Configuration (push) Failing after 15m33s
Test Action / Test PHP (push) Failing after 15m35s
Test Action / Test Base Modules Requires PHP (push) Failing after 10m29s
Test Action / Test Base Modules Installation (push) Failing after 10m31s
Test Action / Test Node (push) Failing after 10m37s
Test Action / Test Build Command (push) Failing after 14m37s
Test Action / Test Custom Server Path (push) Failing after 15m23s
Test Action / Test All Components (push) Failing after 15m25s
Test Action / Test nginx (push) Failing after 15m27s
Test Action / Test Database Configuration (push) Failing after 15m33s
Test Action / Test PHP (push) Failing after 15m35s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
+86
-1
@@ -67,6 +67,34 @@ inputs:
|
||||
description: 'Optional token for private/external repository checkout'
|
||||
required: false
|
||||
default: ''
|
||||
database-uri:
|
||||
description: 'MongoDB connection URI to write into config/system.php (requires install-php; leave empty to keep the repository default)'
|
||||
required: false
|
||||
default: ''
|
||||
database-name:
|
||||
description: 'MongoDB database name to write into config/system.php (requires install-php; leave empty to keep the repository default)'
|
||||
required: false
|
||||
default: ''
|
||||
app-environment:
|
||||
description: 'Application environment to write into config/system.php, e.g. "test" (requires install-php; leave empty to keep the repository default)'
|
||||
required: false
|
||||
default: ''
|
||||
security-salt:
|
||||
description: 'Security salt to write into config/system.php (requires install-php; leave empty to keep the repository default)'
|
||||
required: false
|
||||
default: ''
|
||||
install-base-modules:
|
||||
description: 'Clone, install, and enable the base module set (currently: authentication_provider_password). Requires install-php and a reachable, configured database.'
|
||||
required: false
|
||||
default: 'false'
|
||||
base-modules-repository:
|
||||
description: 'Repository URL for the base password authentication provider module (used when install-base-modules is true)'
|
||||
required: false
|
||||
default: 'https://git.ktrix.dev/Nodarx/authentication_provider_password'
|
||||
base-modules-branch:
|
||||
description: 'Branch, tag, or commit to check out for the base password authentication provider module'
|
||||
required: false
|
||||
default: 'main'
|
||||
|
||||
outputs:
|
||||
install-status:
|
||||
@@ -84,6 +112,9 @@ outputs:
|
||||
nginx-installed:
|
||||
description: 'Whether nginx was installed'
|
||||
value: ${{ steps.install.outputs.nginx_installed }}
|
||||
base-modules-installed:
|
||||
description: 'Whether the base module set was installed'
|
||||
value: ${{ steps.install.outputs.base_modules_installed }}
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
@@ -100,7 +131,13 @@ runs:
|
||||
echo "::error::At least one component must be enabled (install-node, install-php, or install-nginx)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# install-base-modules requires PHP (it runs bin/console)
|
||||
if [ "${{ inputs.install-base-modules }}" == "true" ] && [ "${{ inputs.install-php }}" != "true" ]; then
|
||||
echo "::error::install-base-modules requires install-php to be 'true'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Server path: ${{ inputs.server-path }}"
|
||||
echo "Components to install:"
|
||||
[ "${{ inputs.install-node }}" == "true" ] && echo " ✓ Node.js ${{ inputs.node-version }}"
|
||||
@@ -147,6 +184,25 @@ runs:
|
||||
tools: composer:v2
|
||||
coverage: none
|
||||
|
||||
- name: Configure server settings
|
||||
if: inputs.install-php == 'true'
|
||||
shell: bash
|
||||
env:
|
||||
DATABASE_URI: ${{ inputs.database-uri }}
|
||||
DATABASE_NAME: ${{ inputs.database-name }}
|
||||
APP_ENVIRONMENT: ${{ inputs.app-environment }}
|
||||
SECURITY_SALT: ${{ inputs.security-salt }}
|
||||
run: |
|
||||
echo "::group::Configuring server settings"
|
||||
|
||||
if [ -z "$DATABASE_URI$DATABASE_NAME$APP_ENVIRONMENT$SECURITY_SALT" ]; then
|
||||
echo "No configuration overrides provided, keeping repository defaults."
|
||||
else
|
||||
php "${{ github.action_path }}/scripts/configure-server.php" "${{ inputs.server-path }}/config/system.php"
|
||||
fi
|
||||
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Install nginx
|
||||
if: inputs.install-nginx == 'true'
|
||||
shell: bash
|
||||
@@ -210,6 +266,34 @@ runs:
|
||||
echo "✓ PHP dependencies installed successfully"
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Clone base modules
|
||||
if: inputs.install-base-modules == 'true'
|
||||
uses: Nodarx/action-module-install@main
|
||||
with:
|
||||
modules: |
|
||||
[
|
||||
{
|
||||
"name": "authentication_provider_password",
|
||||
"repo": "${{ inputs.base-modules-repository }}",
|
||||
"branch": "${{ inputs.base-modules-branch }}"
|
||||
}
|
||||
]
|
||||
install-path: ${{ inputs.server-path }}/modules
|
||||
|
||||
- name: Install and enable base modules
|
||||
if: inputs.install-base-modules == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::Installing base modules"
|
||||
cd "${{ inputs.server-path }}"
|
||||
|
||||
echo "Installing authentication_provider_password..."
|
||||
php bin/console module:install authentication_provider_password
|
||||
php bin/console module:enable authentication_provider_password
|
||||
|
||||
echo "✓ Base modules installed"
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Run build command
|
||||
if: inputs.build-command != ''
|
||||
shell: bash
|
||||
@@ -238,3 +322,4 @@ runs:
|
||||
echo "node_installed=${{ inputs.install-node }}" >> $GITHUB_OUTPUT
|
||||
echo "php_installed=${{ inputs.install-php }}" >> $GITHUB_OUTPUT
|
||||
echo "nginx_installed=${{ inputs.install-nginx }}" >> $GITHUB_OUTPUT
|
||||
echo "base_modules_installed=${{ inputs.install-base-modules }}" >> $GITHUB_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user