Skip to content

Commit

Permalink
changed build-frontend.yml and build-backend.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MocStepan committed May 9, 2024
1 parent 0caaa7c commit 5126475
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 85 deletions.
43 changes: 19 additions & 24 deletions .github/workflows/build-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ run-name: "Run ${{github.run_id}}, triggered by ${{github.actor}}"

on:
push:
branches: ["main"]
branches: [ "main" ]
pull_request:
branches: ["main"]
branches: [ "main" ]

jobs:
backend:
Expand All @@ -16,27 +16,22 @@ jobs:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up JDK 17 for backend
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Build and test backend
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
cache-dependency-path: |
backend/*.gradle*
backend/**/gradle-wrapper.properties
- run: ./gradlew build --no-daemon

- name: setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
generate-job-summary: true
add-job-summary-as-pr-comment: on-failure
cache-disabled: true

- name: Build backend and run tests with Gradle Wrapper
run: ./gradlew build

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: backend
file: backend/build/reports/jacoco/test/html/jacocoTestReport.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: backend
file: backend/build/reports/jacoco/test/html/jacocoTestReport.xml
11 changes: 5 additions & 6 deletions .github/workflows/build-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ run-name: "Run ${{github.run_id}}, triggered by ${{github.actor}}"

on:
push:
branches: ["main"]
branches: [ "main" ]
pull_request:
branches: ["main"]
branches: [ "main" ]

jobs:
build:
Expand All @@ -17,14 +17,13 @@ jobs:
working-directory: frontend
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x

- name: Install dependencies
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 20
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm install

- name: Build
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ run-name: "Run ${{github.run_id}}, triggered by ${{github.actor}}"

on:
workflow_dispatch:
pull_request:
branches:
- main

jobs:
deploy-backend:
Expand All @@ -15,7 +18,6 @@ jobs:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ secrets.HEROKU_BACKEND_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: 'main'
appdir: 'backend'
procfile: 'web: java $JAVA_OPTS -Dserver.port=$PORT -jar build/libs/backend-1.0.0.jar --spring.profiles.active=prod'

Expand All @@ -29,5 +31,4 @@ jobs:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ secrets.HEROKU_FRONTEND_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
branch: 'main'
appdir: 'frontend'
51 changes: 0 additions & 51 deletions .github/workflows/development.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ spring:
password: ${SECURITY_PASSWORD}
jwt:
secure: true
sameSite: "none"
sameSite: "Strict"
duration: 86400000 # 1 day
secret: ${JWT_SECRET}
2 changes: 1 addition & 1 deletion backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ spring:
default_schema: public
jwt:
secure: true
sameSite: "none"
sameSite: "Strict"
duration: 86400000 # 1 day
secret: "7A25432A462D4A614E645267556B58703272357538782F413F4428472B4B6250" # random string in base64, should be changed in production

0 comments on commit 5126475

Please sign in to comment.