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

Update build.yaml with debug information and cache keys

This commit is contained in:
Refringe 2024-03-02 14:38:19 -05:00
parent 7e9bd68615
commit 0b956c74cb
No known key found for this signature in database
GPG Key ID: DA8524051241DD36

View File

@ -12,39 +12,59 @@ jobs:
container: container:
image: refringe/spt-build-server:0.0.1 image: refringe/spt-build-server:0.0.1
steps: steps:
- name: Versions - name: Debug Information
run: | run: |
echo "Git version:" && git --version echo "Git version: $(git --version)"
echo "Git LFS version:" && git-lfs --version echo "Git LFS version: $(git-lfs --version)"
echo "Node.js version:" && node --version echo "Node.js version: $(node --version)"
echo "NPM version:" && npm --version echo "NPM version: $(npm --version)"
echo "Latest Commit Hash: $(git rev-parse HEAD)"
echo "Associated Tags: $(git tag --contains HEAD)"
echo "Branch Name: $(git branch --show-current)"
echo "Last Commit Message: $(git log -1 --pretty=%B)"
- name: Cache - name: Cache Keys
id: server-cache id: cache-keys
run: |
echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
TAGS=$(git tag --contains HEAD)
if [[ "$TAGS" == "" ]]; then
TAGS="no-tag"
fi
echo "::set-output name=tags::${TAGS//[$'\n\r']/}"
echo "Commit Hash: ${{ steps.cache-keys.outputs.commit_hash }}"
echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
- name: Build Cache
id: build-cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ./server path: ./server/project/build
key: server-${{ gitea.sha }} key: build-${{ steps.cache-keys.outputs.commit_hash }}-${{ steps.cache-keys.outputs.tags }}
restore-keys: server- restore-keys: |
build-${{ steps.cache-keys.outputs.commit_hash }}-
build-
- name: Clone - name: Clone
if: steps.server-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: | run: |
rm -rf ./server rm -rf ./server
git clone https://dev.sp-tarkov.com/SPT-AKI/Server.git --branch 3.8.0-BE --depth 1 ./server git clone https://dev.sp-tarkov.com/SPT-AKI/Server.git --branch 3.8.0-BE --depth 1 ./server
- name: Pull LFS Files - name: Pull LFS Files
if: steps.server-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: | run: |
cd ./server cd ./server
git lfs pull && git lfs ls-files git lfs pull && git lfs ls-files
- name: Install Dependencies - name: Install Dependencies
if: steps.build-cache.outputs.cache-hit != 'true'
run: | run: |
cd ./server/project cd ./server/project
npm install npm install
- name: Build Server - name: Build Server
if: steps.build-cache.outputs.cache-hit != 'true'
run: | run: |
cd ./server/project cd ./server/project
npm run build:bleeding npm run build:bleeding