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'
required: false
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:
install-status:
@@ -93,22 +109,28 @@ runs:
echo "Install dependencies: ${{ inputs.install-dependencies }}"
echo "::endgroup::"
- name: Clone server repository
shell: bash
run: |
echo "::group::Cloning Nodarx server repository"
if [ -d "${{ inputs.server-path }}" ]; then
echo "Directory exists, pulling latest changes..."
cd "${{ inputs.server-path }}"
git pull --recurse-submodules || echo "::warning::Pull failed, continuing with existing code"
else
echo "Cloning repository..."
git clone --recurse-submodules --depth 1 https://git.ktrix.dev/Nodarx/server "${{ inputs.server-path }}"
fi
echo "Repository cloned/updated successfully"
echo "::endgroup::"
- name: Checkout server repository (public/no token)
if: inputs.checkout-token == ''
uses: actions/checkout@v4
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 }}
- name: Checkout server repository (with token)
if: inputs.checkout-token != ''
uses: actions/checkout@v4
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 }}
token: ${{ inputs.checkout-token }}
- name: Setup Node
if: inputs.install-node == 'true'