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

Update build.yaml and Dockerfile

This commit is contained in:
Refringe 2024-03-01 11:12:38 -05:00
parent 3612cd7640
commit d1809c4124
No known key found for this signature in database
GPG Key ID: DA8524051241DD36
2 changed files with 34 additions and 22 deletions

View File

@ -9,19 +9,23 @@ on:
jobs: jobs:
build-server: build-server:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: refringe/spt-build-environment:latest
steps: steps:
- name: Check-out Server Project - name: Checkout Server Project
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: 'refringe/Server' repository: 'refringe/Server'
fetch-depth: 0 fetch-depth: 0
lfs: true lfs: true
- name: Setup Node.js - name: Checkout Git LFS Objects
uses: actions/setup-node@v4 run: git lfs checkout
with:
node-version: '18.15.0' - name: Setup Node & NPM
run: nvm use
working-directory: ./project
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install

View File

@ -1,22 +1,30 @@
## This image is configured just as the drone runner image but expected to be run locally for # Use the .NET 6.0 SDK base image
## rapid development and testing. It is not intended to be used in production. FROM mcr.microsoft.com/dotnet/sdk:6.0
# Start with the .NET 6.0 SDK Windows Server Core base image # Install necessary tools and dependencies
FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2022 # - wget (for downloading NVM)
# - git & git-lfs
RUN apt-get update && \
apt-get install -y wget git git-lfs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Use PowerShell # Install NVM and use Node v20.10.0 by default
SHELL ["powershell", "-Command"] ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION v20.10.0
RUN mkdir -p $NVM_DIR && \
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION && \
nvm alias default $NODE_VERSION
# Install Chocolatey package manager # Ensure node and npm are available in the PATH
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \ ENV PATH $NVM_DIR/versions/node/$(nvm version)/bin:$PATH
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Use Chocolatey to install Node.js and Git # Set the working directory to /code
RUN choco install nodejs --version=20.10.0 -y WORKDIR /code
RUN choco install git -y
RUN choco install 7zip -y
# Set the working directory to /Code # Add a non-root user for running the build
RUN mkdir -p /Code RUN useradd -m builder
WORKDIR /Code USER builder