Skip to content

Commit

Permalink
refactor: docker release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Guidée <[email protected]>
  • Loading branch information
quentinguidee committed Mar 3, 2024
1 parent 3de0894 commit 6c64c35
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.yarn
node_modules
2 changes: 1 addition & 1 deletion .github/workflows/client-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
context: .
file: docker/Dockerfile
file: client/docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm
no-cache: true
11 changes: 7 additions & 4 deletions .github/workflows/client-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ jobs:
with:
node-version: 16

- name: Enable corepack
run: corepack enable

- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile

- name: Build
run: npm run build
run: yarn workspace @vertex-center/client build

- name: Add version file
run: echo ${{ github.ref_name }} > ./dist/version.txt
run: echo ${{ github.ref_name }} > ./client/dist/version.txt

- name: Create .zip
run: zip client.zip ./dist -r
run: zip client.zip ./client/dist -r

- name: Publish
uses: softprops/action-gh-release@v1
Expand Down
1 change: 0 additions & 1 deletion client/.dockerignore

This file was deleted.

13 changes: 7 additions & 6 deletions client/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM --platform=$BUILDPLATFORM node:alpine3.19 AS build

WORKDIR /app

COPY .. .
COPY . .

RUN npm install
RUN npm run build
RUN corepack enable
RUN yarn install --frozen-lockfile
RUN yarn workspace @vertex-center/client build

FROM nginx:alpine3.18-slim

COPY --from=build /app/dist /usr/share/nginx/html
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY docker/entrypoint.sh /
COPY --from=build /app/client/dist /usr/share/nginx/html
COPY client/docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY client/docker/entrypoint.sh /

RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
24 changes: 0 additions & 24 deletions docker/client.Dockerfile

This file was deleted.

0 comments on commit 6c64c35

Please sign in to comment.