Skip to content

Commit

Permalink
remove be target and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sssomeshhh committed May 27, 2024
1 parent cb5fef2 commit 5206421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 49 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: docker/[email protected]
with:
builder: ${{ steps.setup_buildx.name }}
context: ./fe
context: .
file: Dockerfile
target: fe
cache-from: |
Expand All @@ -33,46 +33,10 @@ jobs:
tags: |
sssomeshhh/rentify:fe
sssomeshhh/rentify:fe-${{ github.sha }}
build-args:
XE=fe

be:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/[email protected]
with:
registry: docker.io
username: sssomeshhh
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Setup Docker Buildx
id: setup_buildx
uses: docker/[email protected]
- name: Build Target
uses: docker/[email protected]
with:
builder: ${{ steps.setup_buildx.name }}
context: ./be
file: Dockerfile
target: be
cache-from: |
type=registry,ref=sssomeshhh/cache:rentify-be
cache-to: |
type=registry,ref=sssomeshhh/cache:rentify-be
load: false
push: true
tags: |
sssomeshhh/rentify:be
sssomeshhh/rentify:be-${{ github.sha }}
build-args:
XE=be
fs:
runs-on: ubuntu-22.04
needs:
- be
- fe
steps:
- name: Checkout
Expand Down
16 changes: 4 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
FROM node:current-bullseye-slim as base
FROM node:current-bullseye-slim as fe
RUN corepack enable
ARG XE
WORKDIR /root/$XE
COPY package.json .
COPY yarn.lock .
COPY ./fe /root
WORKDIR /root/fe
RUN yarn install
COPY . .

FROM base as be
# RUN yarn produce

FROM base as fe
RUN yarn produce

FROM mongo:latest as fs
Expand All @@ -21,7 +13,7 @@ RUN apt-get update && \
apt-get install --yes nodejs && \
corepack enable
COPY --from=sssomeshhh/rentify:fe /root/fe/build /root/fe/build
COPY --from=sssomeshhh/rentify:be /root/be /root/be
COPY ./be /root
WORKDIR /root/be
RUN yarn install
ENV SERVER_PORT=80
Expand Down

0 comments on commit 5206421

Please sign in to comment.