Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update prod commands and build dockers #44

Merged
merged 7 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading