added build args and variables
Some checks are pending
Main / build-and-push-docker-image (20.x) (push) Has started running
Some checks are pending
Main / build-and-push-docker-image (20.x) (push) Has started running
This commit is contained in:
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@@ -53,7 +53,10 @@ jobs:
|
||||
context: .
|
||||
push: ${{ !github.event.pull_request.head.repo.fork }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
build-args: API_URL=DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||
build-args: |
|
||||
DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||
NEXT_PUBLIC_API_TOKEN=${{ secrets.NEXT_PUBLIC_API_TOKEN }}
|
||||
NEXT_PUBLIC_GRAPHQL_URL=${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
|
||||
- name: Build and Push Latest Docker Image
|
||||
id: build-and-push-latest
|
||||
uses: docker/build-push-action@v4
|
||||
@@ -62,4 +65,7 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest
|
||||
build-args: DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||
build-args: |
|
||||
DATABASE_URL=${{ secrets.DATABASE_URL }}
|
||||
NEXT_PUBLIC_API_TOKEN=${{ secrets.NEXT_PUBLIC_API_TOKEN }}
|
||||
NEXT_PUBLIC_GRAPHQL_URL=${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
|
||||
|
||||
@@ -26,6 +26,10 @@ RUN corepack enable
|
||||
RUN corepack prepare yarn@stable --activate
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL=${DATABASE_URL}
|
||||
ARG NEXT_PUBLIC_GRAPHQL_URL
|
||||
ENV NEXT_PUBLIC_GRAPHQL_URL=${NEXT_PUBLIC_GRAPHQL_URL}
|
||||
ARG NEXT_PUBLIC_API_TOKEN
|
||||
ENV NEXT_PUBLIC_API_TOKEN=${NEXT_PUBLIC_API_TOKEN}
|
||||
RUN corepack enable
|
||||
RUN corepack prepare yarn@stable --activate
|
||||
WORKDIR /app
|
||||
|
||||
@@ -58,7 +58,7 @@ const { handleRequest } = createYoga<NextContext>({
|
||||
}),
|
||||
|
||||
// While using Next.js file convention for routing, we need to configure Yoga to use the correct endpoint
|
||||
graphqlEndpoint: "/api/graphql",
|
||||
graphqlEndpoint: process.env.NEXT_PUBLIC_GRAPHQL_URL || "/api/graphql",
|
||||
|
||||
// Yoga needs to know how to create a valid Next response
|
||||
fetchAPI: { Response },
|
||||
|
||||
Reference in New Issue
Block a user