From 159077918248711b87a110a4a7579ead440c943b Mon Sep 17 00:00:00 2001 From: Benoit Quette Date: Wed, 27 Dec 2023 12:55:45 +0100 Subject: [PATCH] run yarn build in workflow --- .github/workflows/publish.yml | 10 ++++++++++ Dockerfile | 15 +++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 307d166..2be3ca1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,6 +15,16 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 + - name: Use Node.js 16 + uses: actions/setup-node@v2-beta + with: + node-version: '16' + + - name: Build Project + run: | + yarn + yarn build + - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: diff --git a/Dockerfile b/Dockerfile index 31c5cc4..f52b4e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,14 @@ FROM node:20.10-alpine3.19 -ENV appDir /usr/src/app +ENV appDir /usr/app -# use changes to package.json to force Docker not to use the cache -# when we change our application's nodejs dependencies: -ADD package.json yarn.lock /tmp/ -RUN cd /tmp && yarn install -RUN mkdir -p ${appDir} && cp -a /tmp/node_modules ${appDir}/ - -# From here we load our application's code in, therefore the previous docker -# "layer" thats been cached will be used if possible +COPY express ${appDir}/express WORKDIR ${appDir} -COPY . ${appDir} RUN yarn build # VOLUME ${appDir}/config +# add webpack generated files +COPY express ${appDir}/express + EXPOSE 5000 WORKDIR ${appDir}/express CMD ["node", "server.js"] \ No newline at end of file