Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexskursky committed Feb 23, 2024
2 parents 246e356 + bb5d753 commit 29550c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/dev-formbricks-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build:
needs: prepare
runs-on: ubuntu-latest
if: ${{ needs.prepare.outputs.branch == 'main' }}
if: ${{ needs.prepare.outputs.branch == 'main' || needs.prepare.outputs.branch == 'devops'}}
outputs:
builder_type: ${{ steps.set_variable.outputs.builder_type }}
env:
Expand All @@ -39,7 +39,6 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to AWS ECR
id: login_ecr
uses: aws-actions/amazon-ecr-login@v1
Expand All @@ -53,14 +52,13 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login_ecr.outputs.registry }}
run: |
cd apps/web
docker build -t $ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:latest --build-arg ENVIRONMENT=dev . --no-cache
docker build --build-arg DATABASE_URL=${{ secrets.DATABASE_URL }} -t $ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:latest . --no-cache
docker push $ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:latest
docker rmi $ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:latest
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{ needs.prepare.outputs.branch == 'main' }}
if: ${{ needs.prepare.outputs.branch == 'main' || needs.prepare.outputs.branch == 'devops'}}

steps:
- name: Update ECS Service
Expand Down
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL

ARG NEXTAUTH_SECRET
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
# ARG NEXTAUTH_SECRET
# ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET

WORKDIR /app

COPY . .
RUN pwd
RUN ls -la
RUN touch ./apps/web/.env


RUN cp .env ./apps/web/.env
#COPY .env .env
RUN pnpm install

# Build the project
RUN pnpm post-install --filter=web...
RUN pnpm turbo run build --filter=web...
Expand Down Expand Up @@ -47,10 +46,6 @@ EXPOSE 3000

ENV HOSTNAME "0.0.0.0"

CMD if [ "$NEXTAUTH_SECRET" != "RANDOM_STRING" ]; then \
pnpm dlx prisma migrate deploy && \
node apps/web/server.js; \
else \
echo "ERROR: Please set a value for NEXTAUTH_SECRET in your docker compose variables!"; \
exit 1; \
fi
CMD pnpm dlx prisma migrate deploy && \
node apps/web/pre-setup-server.js; \
node apps/web/server.js; docker

0 comments on commit 29550c1

Please sign in to comment.