-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,6 @@ jobs: | |
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: dotnet publish | ||
run: | | ||
dotnet publish ./MvcAuthTemplate/ -o publish -c release -r linux-x64 | ||
|
||
- name: repository name fix | ||
run: echo "image_repository_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
|
@@ -26,7 +22,7 @@ jobs: | |
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
with: | ||
file: MvcAuthTemplate/Dockerfile | ||
file: Dockerfile | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ env.image_repository_name }}:${{ github.event.release.tag_name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build | ||
WORKDIR /source | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ | ||
&& apt-get install -y --no-install-recommends nodejs \ | ||
&& echo "node version: $(node --version)" \ | ||
&& echo "npm version: $(npm --version)" \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY MvcAuthTemplate/package.json . | ||
COPY MvcAuthTemplate/npm-shrinkwrap.json . | ||
|
||
RUN npm --prefix MvcAuthTemplate install | ||
|
||
COPY . . | ||
RUN dotnet restore | ||
|
||
WORKDIR /source/MvcAuthTemplate | ||
RUN dotnet publish -c release -o /app --no-restore | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime | ||
WORKDIR /app | ||
COPY --from=build /app ./ | ||
ENTRYPOINT ["dotnet", "MvcAuthTemplate.dll"] |