Skip to content

Commit

Permalink
ci: update prod commands and build dockers (#44)
Browse files Browse the repository at this point in the history
* bump nodejs to 18 in Dockerfile

Signed-off-by: Grzegorz Choiński <[email protected]>
  • Loading branch information
Wallted authored Jan 27, 2024
1 parent 0fbae10 commit 51b65e3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,23 @@ jobs:
run: npm install

- name: Run build command
run: npm run build
run: npm run build-prod

build-docker:
needs: [build-dotnet, build-npm]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build the Docker image
run: docker build ./Foodie --tag foodie:$(date +%s)

build-nginx:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build the Docker image
run: docker build ./nginx -f ./nginx/Nginx.Dockerfile --tag reverseproxy:$(date +%s)
6 changes: 3 additions & 3 deletions Foodie/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bin\
obj\
bin/
obj/
.git
ClientApp\node_modules\
ClientApp/node_modules/
1 change: 0 additions & 1 deletion Foodie/ClientApp/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down
2 changes: 2 additions & 0 deletions Foodie/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-prod": "ng build --configuration production",
"build:ssr": "ng run Foodie:server:dev",
"build-prod:ssr": "ng run Foodie:server:production",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
Expand Down
2 changes: 1 addition & 1 deletion Foodie/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash \
&& apt-get install nodejs -yq
WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions Foodie/Foodie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build-prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build-prod:ssr" Condition=" '$(BuildServerSideRenderer)' == 'true' " />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
Expand Down

0 comments on commit 51b65e3

Please sign in to comment.