0
0
mirror of https://github.com/sp-tarkov/build.git synced 2025-02-12 16:50:45 -05:00

Removes redundant caching and tag fetch

This commit is contained in:
Refringe 2025-01-04 00:14:17 -05:00
parent e6ef1ada22
commit 96a9fdc96d
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k

View File

@ -185,25 +185,23 @@ jobs:
- name: Clone Server - name: Clone Server
shell: pwsh shell: pwsh
run: | run: |
# If found, remove any existing folder from a previous run
$serverPath = "$env:GITHUB_WORKSPACE\SPT\Build\server" $serverPath = "$env:GITHUB_WORKSPACE\SPT\Build\server"
# Delete old remnants of the last build.
if (Test-Path $serverPath) { if (Test-Path $serverPath) {
Remove-Item -Recurse -Force $serverPath Remove-Item -Recurse -Force $serverPath
} }
# Decide which ref to clone.
if ("${{ needs.prepare.outputs.is_nightly }}" -eq "true") {
$TARGET = "${{ needs.prepare.outputs.branch_server }}"
} else {
$TARGET = "${{ needs.prepare.outputs.target_tag }}"
}
# Clone the server repo Write-Host "Cloning: $TARGET"
git clone --depth=1 https://github.com/sp-tarkov/server.git $serverPath git clone https://github.com/sp-tarkov/server.git --branch $TARGET --depth 1 $serverPath
# Move into the cloned repo # Pull LFS files.
Set-Location $serverPath Set-Location $serverPath
# Fetch tags if needed
git fetch --tags
# Checkout the ref (branch or tag) from $env.TARGET
git checkout $env:TARGET
# Install LFS and pull files
git lfs install --local git lfs install --local
git lfs pull git lfs pull
@ -219,22 +217,7 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "SPT/Build/server/project/package.json" cache-dependency-path: "SPT/Build/server/project/package.json"
- name: Get npm cache directory
id: npm-cache-dir
shell: pwsh
run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
- name: Check NPM Cache
id: cache-check
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM Dependencies - name: Install NPM Dependencies
if: steps.cache-check.outputs.cache-hit != 'true'
run: npm install run: npm install
working-directory: ./SPT/Build/server/project working-directory: ./SPT/Build/server/project