From cec1d1c4ee2b8472eef19f75b6e2f05694e28c0c Mon Sep 17 00:00:00 2001 From: Lauro Correia Silveira Date: Thu, 16 Nov 2023 10:30:06 +0100 Subject: [PATCH] Fix deploy Render. Strint connection to mongodb error --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/docker-image.yml | 20 -------------------- Dockerfile | 7 +------ 3 files changed, 10 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17071e9..3e2f225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,4 +58,12 @@ jobs: ${{ github.workspace }}/target/site/jacoco/jacoco.xml, token: ${{ secrets.SECRET_TOKEN }} min-coverage-overall: 40 - min-coverage-changed-files: 60 \ No newline at end of file + min-coverage-changed-files: 60 + + docker: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build Docker Image + run: docker build . --file Dockerfile --tag alura-flix-api:$(date +%s) --build-arg DATABASE_PRO=${{ secrets.DATABASE_PRO }} --build-arg DATABASE_TEST=${{ secrets.DATABASE_TEST }} --build-arg DATABASE_TEST=${{ secrets.DATABASE_TEST }} \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 6dd8724..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - env: - JWT_SECRET: ${{ secrets.JWT_SECRET }} - DATABASE_PRO: ${{ secrets.DATABASE_PRO }} - DATABASE_TEST: ${{ secrets.DATABASE_TEST }} - - - name: Build the Docker image - run: docker build . --file Dockerfile --tag alura-flix-api:$(date +%s) --build-arg DATABASE_PRO=${{ secrets.DATABASE_PRO }} --build-arg DATABASE_TEST=${{ secrets.DATABASE_TEST }} --build-arg DATABASE_TEST=${{ secrets.DATABASE_TEST }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 82b1a60..cdcb29e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,6 @@ FROM maven:3.9.4-eclipse-temurin-21-alpine AS build COPY . . - -ARG DATABASE_PRO -ARG DATABASE_TEST -ARG JWT_SECRET - -RUN mvn clean package +RUN mvn clean package FROM eclipse-temurin:21-jre-alpine ## Arguments used with github secrets