fix: load copy env file in build
Some checks failed
CI / build-and-test (push) Failing after 2m42s

This commit is contained in:
Tobias Klemp
2026-01-02 16:21:08 +01:00
parent 9166be8ab0
commit 2b54ec69ae
2 changed files with 10 additions and 9 deletions

View File

@@ -15,13 +15,13 @@ jobs:
id: branch_name id: branch_name
uses: ./.gitea/actions/getTagSafeRef uses: ./.gitea/actions/getTagSafeRef
# - name: Build and push image - name: Build and push image
# id: docker_build id: docker_build
# uses: ./.gitea/actions/build uses: ./.gitea/actions/build
# with: with:
# tag: ${{ steps.branch_name.outputs.branch_name }} tag: ${{ steps.branch_name.outputs.branch_name }}
# REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }} REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
# REGISTRY_USER: ${{ gitea.actor }} REGISTRY_USER: ${{ gitea.actor }}
# - name: Deploy application # - name: Deploy application
# uses: ./.gitea/actions/deploy # uses: ./.gitea/actions/deploy

View File

@@ -7,12 +7,12 @@ WORKDIR /usr/src/app
# this will cache them and speed up future builds # this will cache them and speed up future builds
FROM base AS install FROM base AS install
RUN mkdir -p /temp/dev 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 RUN cd /temp/dev && bun install --frozen-lockfile
# install with --production (exclude devDependencies) # install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod 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 RUN cd /temp/prod && bun install --frozen-lockfile --production
# copy node_modules from temp directory # copy node_modules from temp directory
@@ -28,6 +28,7 @@ RUN bun --bun run build
# copy production dependencies and source code into final image # copy production dependencies and source code into final image
FROM base AS release FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules COPY --from=install /temp/prod/node_modules node_modules
COPY --from=install /temp/prod/.env .env
COPY --from=prerelease /usr/src/app/build . COPY --from=prerelease /usr/src/app/build .
# run the app # run the app