Merge pull request 'chore: improve server checkout' (#2) from chore/improve-server-checkout into main
All checks were successful
Test Action / Test Node (push) Successful in 18s
Test Action / Test nginx (push) Successful in 21s
Test Action / Test Custom Server Path (push) Successful in 25s
Test Action / Test Build Command (push) Successful in 27s
Test Action / Test PHP (push) Successful in 1m8s
Test Action / Test All Components (push) Successful in 1m43s
All checks were successful
Test Action / Test Node (push) Successful in 18s
Test Action / Test nginx (push) Successful in 21s
Test Action / Test Custom Server Path (push) Successful in 25s
Test Action / Test Build Command (push) Successful in 27s
Test Action / Test PHP (push) Successful in 1m8s
Test Action / Test All Components (push) Successful in 1m43s
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
52
action.yml
52
action.yml
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user