Skip to content

Commit 12f29c8

Browse files
committed
mod: path
1 parent 730d765 commit 12f29c8

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/frontend-docker-cicd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v2
1515

16+
- name: Prepare Docker context
17+
run: |
18+
mkdir -p frontend/zicdding-class.com
19+
cp package.json frontend/zicdding-class.com/
20+
cp yarn.lock frontend/zicdding-class.com/
21+
1622
- name: Set up Docker Buildx
1723
uses: docker/setup-buildx-action@v1
1824

frontend/zicdding-class.com/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ WORKDIR /app
55

66
ENV ENV=production
77

8-
# Copy package.json and yarn.lock from the frontend directory
9-
COPY ../package.json ../yarn.lock ./
8+
# Copy package.json and yarn.lock from the frontend directory to the Docker build context
9+
COPY package.json yarn.lock ./
1010

1111
# Install dependencies
1212
RUN yarn install --frozen-lockfile
1313

14-
# Copy the rest of the code from the frontend directory
15-
COPY ../ /app/
14+
# Copy the rest of the code from the frontend directory to the Docker build context
15+
COPY . .
1616

1717
# Focus workspaces and build the project
1818
RUN yarn workspaces focus @zicdding-web/ui @zicdding-web/zicdding-class-com
19-
WORKDIR /app/zicdding-class.com
19+
WORKDIR /app/frontend/zicdding-class.com
2020
RUN yarn build
2121

2222
# Production stage
@@ -27,9 +27,9 @@ WORKDIR /app
2727
ENV ENV=production
2828

2929
# Copy built files from the build stage
30-
COPY --from=build /app/zicdding-class.com/build ./build
31-
COPY --from=build /app/zicdding-class.com/package.json ./package.json
32-
COPY --from=build /app/zicdding-class.com/node_modules ./node_modules
30+
COPY --from=build /app/frontend/zicdding-class.com/build ./build
31+
COPY --from=build /app/frontend/zicdding-class.com/package.json ./package.json
32+
COPY --from=build /app/frontend/zicdding-class.com/node_modules ./node_modules
3333

3434
EXPOSE 3000
3535

0 commit comments

Comments
 (0)