From fcd8c034b97aab10c0fc4c837bfaf902dad8e981 Mon Sep 17 00:00:00 2001 From: commoner02 <77.shuvo.joy@gmail.com> Date: Mon, 16 Feb 2026 18:33:53 +0600 Subject: [PATCH 1/3] config updated for hosting on render --- .github/workflows/workflow.yml | 22 +++++++++--- .gitignore | 7 +++- src/main/resources/application.properties | 43 ++++++++++++++++------- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0d02270..8d96717 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,14 +2,14 @@ name: Spring Boot CI/CD on: push: - branches: [ "dev", "feature/*", "fix/*", test/*" ] + branches: [ "dev", "feature/*", "fix/*", "test/*" ] pull_request: branches: [ "main" ] + workflow_dispatch: jobs: - build-and-test: + test: runs-on: ubuntu-latest - services: postgres: image: postgres:latest @@ -41,4 +41,18 @@ jobs: SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/smsdb_test SPRING_DATASOURCE_USERNAME: admin SPRING_DATASOURCE_PASSWORD: pass123 - SPRING_JPA_HIBERNATE_DDL_AUTO: update \ No newline at end of file + SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop + + deploy: + needs: test + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Trigger Render Deployment + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.RENDER_API_KEY }}" \ + -H "Content-Type: application/json" \ + -d '{}' \ + https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/deploys \ No newline at end of file diff --git a/.gitignore b/.gitignore index 667aaef..618189e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,11 @@ target/ !**/src/main/**/target/ !**/src/test/**/target/ +# Environment files +.env +.env.local +.env.* + ### STS ### .apt_generated .classpath @@ -30,4 +35,4 @@ build/ !**/src/test/**/build/ ### VS Code ### -.vscode/ +.vscode/ \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 00f31bb..56f375d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,22 +1,39 @@ -# Database Configuration -spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/smsdb} -spring.datasource.username=${SPRING_DATASOURCE_USERNAME:admin} -spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:pass123} +## Database Configuration +#spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/smsdb} +#spring.datasource.username=${SPRING_DATASOURCE_USERNAME:admin} +#spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:pass123} +#spring.datasource.driver-class-name=org.postgresql.Driver +# +## JPA/Hibernate +#spring.jpa.hibernate.ddl-auto=${SPRING_JPA_HIBERNATE_DDL_AUTO:update} +#spring.jpa.show-sql=${SPRING_JPA_SHOW_SQL:false} +#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +#spring.jpa.properties.hibernate.format_sql=true +# +## Server +#server.port=8080 +# +## Thymeleaf +#spring.thymeleaf.prefix=classpath:/templates/ +#spring.thymeleaf.suffix=.html +#spring.thymeleaf.cache=false +# +## Security (for development) +#spring.security.filter.order=10 + +# Database Configuration - Render provides these env vars +spring.datasource.url=${SPRING_DATASOURCE_URL} +spring.datasource.username=${SPRING_DATASOURCE_USERNAME} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD} spring.datasource.driver-class-name=org.postgresql.Driver # JPA/Hibernate spring.jpa.hibernate.ddl-auto=${SPRING_JPA_HIBERNATE_DDL_AUTO:update} spring.jpa.show-sql=${SPRING_JPA_SHOW_SQL:false} -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.format_sql=true -# Server -server.port=8080 +# Server - Render sets PORT env var +server.port=${PORT:8080} # Thymeleaf -spring.thymeleaf.prefix=classpath:/templates/ -spring.thymeleaf.suffix=.html -spring.thymeleaf.cache=false - -# Security (for development) -spring.security.filter.order=10 \ No newline at end of file +spring.thymeleaf.cache=false \ No newline at end of file From e8afe56772087ced6aeea1fb920f454bde478933 Mon Sep 17 00:00:00 2001 From: commoner02 <77.shuvo.joy@gmail.com> Date: Mon, 16 Feb 2026 18:52:15 +0600 Subject: [PATCH 2/3] workflow edited for convenience --- .github/workflows/workflow.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..a1e3f22 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,4 @@ +name: workflow.yml +on: + +jobs: From 5c13980cec31fa5c30ae33d74707433c81ab1bc3 Mon Sep 17 00:00:00 2001 From: commoner02 <77.shuvo.joy@gmail.com> Date: Mon, 16 Feb 2026 19:08:26 +0600 Subject: [PATCH 3/3] config for hosting on render --- .github/workflows/workflow.yml | 22 ++++++++++++++++++---- src/main/resources/application.properties | 3 ++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0d02270..8d96717 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,14 +2,14 @@ name: Spring Boot CI/CD on: push: - branches: [ "dev", "feature/*", "fix/*", test/*" ] + branches: [ "dev", "feature/*", "fix/*", "test/*" ] pull_request: branches: [ "main" ] + workflow_dispatch: jobs: - build-and-test: + test: runs-on: ubuntu-latest - services: postgres: image: postgres:latest @@ -41,4 +41,18 @@ jobs: SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/smsdb_test SPRING_DATASOURCE_USERNAME: admin SPRING_DATASOURCE_PASSWORD: pass123 - SPRING_JPA_HIBERNATE_DDL_AUTO: update \ No newline at end of file + SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop + + deploy: + needs: test + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Trigger Render Deployment + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.RENDER_API_KEY }}" \ + -H "Content-Type: application/json" \ + -d '{}' \ + https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/deploys \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 56f375d..f463bca 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -36,4 +36,5 @@ spring.jpa.properties.hibernate.format_sql=true server.port=${PORT:8080} # Thymeleaf -spring.thymeleaf.cache=false \ No newline at end of file +spring.thymeleaf.cache=false +