chore: improve server checkout
All checks were successful
Test Action / Test Node (pull_request) Successful in 17s
Test Action / Test nginx (pull_request) Successful in 21s
Test Action / Test Custom Server Path (pull_request) Successful in 25s
Test Action / Test Build Command (pull_request) Successful in 25s
Test Action / Test PHP (pull_request) Successful in 1m15s
Test Action / Test All Components (pull_request) Successful in 1m21s

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-02-15 17:21:09 -05:00
parent 6461eddc8c
commit 049fe228a5

View File

@@ -51,6 +51,22 @@ inputs:
description: 'Custom script to run after installation' description: 'Custom script to run after installation'
required: false required: false
default: '' default: ''
server-repository:
description: 'Repository to checkout for the server source'
required: false
default: 'Nodarx/server'
server-ref:
description: 'Branch, tag, or SHA to checkout for the server repository'
required: false
default: 'main'
github-server-url:
description: 'Git server base URL for checkout (e.g. https://git.ktrix.dev)'
required: false
default: 'https://git.ktrix.dev'
checkout-token:
description: 'Optional token for private/external repository checkout'
required: false
default: ''
outputs: outputs:
install-status: install-status:
@@ -93,22 +109,28 @@ runs:
echo "Install dependencies: ${{ inputs.install-dependencies }}" echo "Install dependencies: ${{ inputs.install-dependencies }}"
echo "::endgroup::" echo "::endgroup::"
- name: Clone server repository - name: Checkout server repository (public/no token)
shell: bash if: inputs.checkout-token == ''
run: | uses: actions/checkout@v4
echo "::group::Cloning Nodarx server repository" with:
repository: ${{ inputs.server-repository }}
ref: ${{ inputs.server-ref }}
path: ${{ inputs.server-path }}
fetch-depth: 1
submodules: recursive
github-server-url: ${{ inputs.github-server-url }}
if [ -d "${{ inputs.server-path }}" ]; then - name: Checkout server repository (with token)
echo "Directory exists, pulling latest changes..." if: inputs.checkout-token != ''
cd "${{ inputs.server-path }}" uses: actions/checkout@v4
git pull --recurse-submodules || echo "::warning::Pull failed, continuing with existing code" with:
else repository: ${{ inputs.server-repository }}
echo "Cloning repository..." ref: ${{ inputs.server-ref }}
git clone --recurse-submodules --depth 1 https://git.ktrix.dev/Nodarx/server "${{ inputs.server-path }}" path: ${{ inputs.server-path }}
fi fetch-depth: 1
submodules: recursive
echo "Repository cloned/updated successfully" github-server-url: ${{ inputs.github-server-url }}
echo "::endgroup::" token: ${{ inputs.checkout-token }}
- name: Setup Node - name: Setup Node
if: inputs.install-node == 'true' if: inputs.install-node == 'true'