database url secret / env variable for ci/cd
Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 3m44s
Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 3m44s
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -53,6 +53,8 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: ${{ !github.event.pull_request.head.repo.fork }}
|
push: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
API_URL=DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||||
- name: Build and Push Latest Docker Image
|
- name: Build and Push Latest Docker Image
|
||||||
id: build-and-push-latest
|
id: build-and-push-latest
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
@@ -61,3 +63,5 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest
|
tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest
|
||||||
|
build-args: |
|
||||||
|
DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
ARG DATABASE_URL
|
||||||
|
|
||||||
# --- Stage 1: Dependencies ---
|
# --- Stage 1: Dependencies ---
|
||||||
FROM node:20-alpine AS dependencies
|
FROM node:20-alpine AS dependencies
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
@@ -8,6 +10,7 @@ RUN yarn install
|
|||||||
|
|
||||||
# --- Stage 2: Builder ---
|
# --- Stage 2: Builder ---
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
ENV DATABASE_URL=${DATABASE_URL}
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
RUN corepack prepare yarn@stable --activate
|
RUN corepack prepare yarn@stable --activate
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -18,6 +21,7 @@ RUN yarn build
|
|||||||
|
|
||||||
# --- Stage 3: Runner ---
|
# --- Stage 3: Runner ---
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
|
ENV DATABASE_URL=$DATABASE_URL
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
RUN corepack prepare yarn@stable --activate
|
RUN corepack prepare yarn@stable --activate
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
Reference in New Issue
Block a user