database url secret / env variable for ci/cd
Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 3m44s

This commit is contained in:
2025-12-06 15:05:13 -05:00
parent 583cb0f9b9
commit 45cc9627c5
2 changed files with 8 additions and 0 deletions

View File

@@ -53,6 +53,8 @@ jobs:
context: .
push: ${{ !github.event.pull_request.head.repo.fork }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
API_URL=DATABASE_URL=${{ secrets.DATABASE_URL }}
- name: Build and Push Latest Docker Image
id: build-and-push-latest
uses: docker/build-push-action@v4
@@ -61,3 +63,5 @@ jobs:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest
build-args: |
DATABASE_URL=${{ secrets.DATABASE_URL }}

View File

@@ -1,3 +1,5 @@
ARG DATABASE_URL
# --- Stage 1: Dependencies ---
FROM node:20-alpine AS dependencies
RUN corepack enable
@@ -8,6 +10,7 @@ RUN yarn install
# --- Stage 2: Builder ---
FROM node:20-alpine AS builder
ENV DATABASE_URL=${DATABASE_URL}
RUN corepack enable
RUN corepack prepare yarn@stable --activate
WORKDIR /app
@@ -18,6 +21,7 @@ RUN yarn build
# --- Stage 3: Runner ---
FROM node:20-alpine AS runner
ENV DATABASE_URL=$DATABASE_URL
RUN corepack enable
RUN corepack prepare yarn@stable --activate
WORKDIR /app