Skip to content

Commit 4f75f81

Browse files
committed
Move npm publish out of Dockerfile and into Release step before docker
1 parent 7dd93cf commit 4f75f81

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ jobs:
88
steps:
99
- name: checkout
1010
uses: actions/checkout@v2
11+
- name: Setup node
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 14
15+
- name: Install and build npm
16+
run: |
17+
npm install
18+
npm run publish
19+
working-directory: ./ui
1120

1221
- name: repository name fix
1322
run: echo "image_repository_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

Dockerfile

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
2-
3-
RUN apt-get update -yq \
4-
&& apt-get -yq install curl gnupg ca-certificates \
5-
&& curl -L https://deb.nodesource.com/setup_lts.x | bash \
6-
&& apt-get update -yq \
7-
&& apt-get install -yq \
8-
nodejs
9-
1+
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
102
WORKDIR /app
113

12-
COPY ./ui ./ui
13-
COPY ./api ./api
14-
15-
WORKDIR /app/ui
16-
RUN npm install && npm run publish
17-
18-
WORKDIR /app/api
4+
COPY . .
195
RUN dotnet restore
206

21-
WORKDIR /app/api/MyApp
7+
WORKDIR /app/MyApp
228
RUN dotnet publish -c release -o /out --no-restore
239

24-
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS runtime
10+
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
2511
WORKDIR /app
2612
COPY --from=build /out .
2713
ENTRYPOINT ["dotnet", "MyApp.dll"]

0 commit comments

Comments
 (0)