🔨 Add github actions
Some checks failed
Build and Push Dyson Sphere / build (push) Has been cancelled

This commit is contained in:
2025-05-18 22:40:07 +08:00
parent a86a0fef37
commit 2fca5310be
3 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1 @@
node_modules

View File

@ -6,24 +6,18 @@ EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
# Install Node.js
RUN apt-get update && apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
RUN apt-get update && apt-get install -y nodejs npm
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["DysonNetwork.Sphere/DysonNetwork.Sphere.csproj", "DysonNetwork.Sphere/"]
COPY ["DysonNetwork.Sphere.csproj", "DysonNetwork.Sphere/"]
RUN dotnet restore "DysonNetwork.Sphere/DysonNetwork.Sphere.csproj"
COPY . .
WORKDIR "/src/DysonNetwork.Sphere"
COPY . .
# Install npm packages and build Tailwind CSS
COPY ["DysonNetwork.Sphere/package*.json", "./"]
RUN npm install
COPY ["DysonNetwork.Sphere/postcss.config.js", "./"]
COPY ["DysonNetwork.Sphere/wwwroot/css/site.css", "./wwwroot/css/"]
RUN npx @tailwindcss/cli -i ./wwwroot/css/site.css -o ./wwwroot/css/styles.css
RUN npm run css:build
RUN dotnet build "DysonNetwork.Sphere.csproj" -c $BUILD_CONFIGURATION -o /app/build