From 2b54ec69aebb01d87d85628822d58307dcbb2b85 Mon Sep 17 00:00:00 2001 From: Tobias Klemp Date: Fri, 2 Jan 2026 16:21:08 +0100 Subject: [PATCH] fix: load copy env file in build --- .gitea/workflows/commentDeploy.yml | 14 +++++++------- Dockerfile | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/commentDeploy.yml b/.gitea/workflows/commentDeploy.yml index 6f9bbc0..b560ded 100644 --- a/.gitea/workflows/commentDeploy.yml +++ b/.gitea/workflows/commentDeploy.yml @@ -15,13 +15,13 @@ jobs: id: branch_name uses: ./.gitea/actions/getTagSafeRef - # - name: Build and push image - # id: docker_build - # uses: ./.gitea/actions/build - # with: - # tag: ${{ steps.branch_name.outputs.branch_name }} - # REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }} - # REGISTRY_USER: ${{ gitea.actor }} + - name: Build and push image + id: docker_build + uses: ./.gitea/actions/build + with: + tag: ${{ steps.branch_name.outputs.branch_name }} + REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }} + REGISTRY_USER: ${{ gitea.actor }} # - name: Deploy application # uses: ./.gitea/actions/deploy diff --git a/Dockerfile b/Dockerfile index 54d117d..1199855 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,12 @@ WORKDIR /usr/src/app # this will cache them and speed up future builds FROM base AS install RUN mkdir -p /temp/dev -COPY package.json bun.lock /temp/dev/ +COPY .env package.json bun.lock /temp/dev/ RUN cd /temp/dev && bun install --frozen-lockfile # install with --production (exclude devDependencies) RUN mkdir -p /temp/prod -COPY package.json bun.lock /temp/prod/ +COPY .env package.json bun.lock /temp/prod/ RUN cd /temp/prod && bun install --frozen-lockfile --production # copy node_modules from temp directory @@ -28,6 +28,7 @@ RUN bun --bun run build # copy production dependencies and source code into final image FROM base AS release COPY --from=install /temp/prod/node_modules node_modules +COPY --from=install /temp/prod/.env .env COPY --from=prerelease /usr/src/app/build . # run the app