FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app

# Copy everything
COPY . ./
# Build and publish a release
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:6.0
WORKDIR /app
COPY --from=build-env /app/out .
# Must specify absolute path to the executable
# GitHub actions will pass in custom working directory
ENTRYPOINT ["dotnet", "/app/GitHubAction.dll"]
