Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 52 additions & 20 deletions .github/workflows/buildDeployStartAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Build-Deploy-Start-All
on:
push:
branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -15,24 +16,24 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 7.3
arguments: bootJar
- name: Deploy to server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SOURCE: "build/libs/"
TARGET: ${{ secrets.REMOTE_TARGET_BACKEND }}

- name: Upload Backend Build Artifact
uses: actions/upload-artifact@v4
with:
name: backend-build
path: build/libs/*.jar

frontend:
needs: backend
Expand All @@ -44,34 +45,65 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Use Node.js lts/iron
uses: actions/setup-node@v4
with:
node-version: lts/iron
check-latest: true
cache: 'npm'
cache-dependency-path: "./frontend/package-lock.json"
- run: npm ci #--legacy-peer-deps

- run: npm ci --legacy-peer-deps
- run: CI=true npm run build --if-present
- name: Deploy to server

- name: Upload Frontend Build Artifact
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: frontend/build

deploy_start:
needs: frontend
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

steps:
- name: Download Backend Build Artifact
uses: actions/download-artifact@v4
with:
name: backend-build
path: build/libs/

- name: Download Frontend Build Artifact
uses: actions/download-artifact@v4
with:
name: frontend-build
path: frontend/build/

- name: Deploy Backend to Server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SOURCE: "frontend/build"
TARGET: ${{ secrets.REMOTE_TARGET_FRONTEND }}
SOURCE: "build/libs/"
TARGET: ${{ secrets.REMOTE_TARGET_BACKEND }}

start:
needs: frontend
runs-on: ubuntu-latest
- name: Deploy Frontend to Server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SOURCE: "frontend/build/"
TARGET: ${{ secrets.REMOTE_TARGET_FRONTEND }}

steps:
- name: SSH Remote Commands
- name: Start Services on Server
uses: appleboy/ssh-action@v1.0.3
with:
key: ${{ secrets.REMOTE_SSH_KEY }}
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
script: |
./createDockerImagesAndRun.sh
./createDockerImagesAndRun.sh
74 changes: 49 additions & 25 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"proxy": "http://localhost:8080",
"//": "override versions of nth-check and postcss to fix security vulnerabilities with react-scripts 5.0.1, see overrides at end",
"dependencies": {
"@heroicons/react": "^2.1.1",
"@heroicons/react": "^2.2.0",
"nth-check": "^2.1.1",
"postcss": "^8.4.35",
"postcss": "^8.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.0",
"react-toastify": "^10.0.4",
"react18-json-view": "^0.2.7"
"react18-json-view": "^0.2.9"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Expand Down
Loading