This commit is contained in:
@@ -15,18 +15,19 @@ 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
|
||||||
with:
|
with:
|
||||||
project_name: ${{ steps.branch_name.outputs.branch_name }}
|
project_name: ${{ steps.branch_name.outputs.branch_name }}
|
||||||
url: '${{ steps.branch_name.outputs.branch_name }}.phoenix.klemp.local'
|
url: '${{ steps.branch_name.outputs.branch_name }}.phoenix.klemp.local'
|
||||||
image_url: ${{ steps.docker_build.outputs.image_url }}
|
# image_url: ${{ steps.docker_build.outputs.image_url }}
|
||||||
|
image_url: 'git.klemp.dev/tech-reborn/phoenix:feature-branch-deployments'
|
||||||
deployment_key: ${{ secrets.SSH_DEPLOYMENT_KEY }}
|
deployment_key: ${{ secrets.SSH_DEPLOYMENT_KEY }}
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -3,7 +3,14 @@
|
|||||||
FROM oven/bun:1 AS base
|
FROM oven/bun:1 AS base
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# install dependencies into temp directory
|
||||||
|
# this will cache them and speed up future builds
|
||||||
FROM base AS install
|
FROM base AS install
|
||||||
|
RUN mkdir -p /temp/dev
|
||||||
|
COPY package.json bun.lock /temp/dev/
|
||||||
|
RUN cd /temp/dev && bun install --frozen-lockfile
|
||||||
|
|
||||||
|
# install with --production (exclude devDependencies)
|
||||||
RUN mkdir -p /temp/prod
|
RUN mkdir -p /temp/prod
|
||||||
COPY package.json bun.lock /temp/prod/
|
COPY package.json bun.lock /temp/prod/
|
||||||
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
||||||
@@ -11,12 +18,14 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
|
|||||||
# copy node_modules from temp directory
|
# copy node_modules from temp directory
|
||||||
# then copy all (non-ignored) project files into the image
|
# then copy all (non-ignored) project files into the image
|
||||||
FROM base AS prerelease
|
FROM base AS prerelease
|
||||||
COPY --from=install /temp/prod/node_modules node_modules
|
COPY --from=install /temp/dev/node_modules node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# build
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN bun --bun run build
|
RUN bun --bun run build
|
||||||
|
|
||||||
|
# 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=prerelease /usr/src/app/build .
|
COPY --from=prerelease /usr/src/app/build .
|
||||||
|
|||||||
Reference in New Issue
Block a user