Skip to content

Commit

Permalink
stablishing develop branch and enabling build workflow trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
francav committed Apr 26, 2024
1 parent 5149ee6 commit e12125f
Show file tree
Hide file tree
Showing 154 changed files with 2,678 additions and 2,621 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Deploy

on:
workflow_dispatch:
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build artifacts

on:
push:
branches:
- main
- develop
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY_OWNER: wkspower
KEYCLOAK_URL: http://localhost:8082
WKS_API_URL: http://localhost:8081
WKS_STORAGE_API_URL: http://localhost:8085
WEBSOCKET_ENABLED: false
WEBSOCKET_URL: ws://localhost:8484
TOPIC_CASE_CREATE: case-create
TOPIC_CREATE_HUMAN_TASK: human-task-create
NOVU_ENABLED: false
NOVU_PUBLISHER_API_URL: http://localhost:3002

jobs:
checkout-repo:
runs-on: ubuntu-latest
outputs:
repo-path: ${{ steps.checkout.outputs.repo-path }}
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v3
- name: Get repo path
run: echo "::set-output name=repo-path::$(pwd)"

build-java:
runs-on: ubuntu-latest
needs: checkout-repo
permissions:
contents: read
packages: write
steps:
- name: Set up jdk 18
uses: actions/setup-java@v3
with:
java-version: "18"
distribution: "temurin"

- name: Set up maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.2

- name: Build all for backend api
run: mvn -B package --file ${{ needs.checkout-repo.outputs.repo-path }}/apps/java/pom.xml

build-react:
runs-on: ubuntu-latest
needs: checkout-repo
permissions:
contents: read
packages: write
steps:
- name: Install dependencies for case-portal
run: yarn --cwd ${{ needs.checkout-repo.outputs.repo-path }}/apps/react/case-portal install

- name: Build for case-portal
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
export REACT_APP_KEYCLOAK_URL="${{ env.KEYCLOAK_URL }}"
export REACT_APP_API_URL="${{ env.WKS_API_URL }}"
export REACT_APP_STORAGE_URL="${{ env.WKS_STORAGE_API_URL }}"
export REACT_APP_WEBSOCKETS_ENABLED="${{ env.WEBSOCKET_ENABLED }}"
export REACT_APP_WEBSOCKETS_URL="${{ env.WEBSOCKET_URL }}"
export REACT_APP_WEBSOCKETS_CASE_CREATED="${{ env.TOPIC_CASE_CREATE }}"
export REACT_APP_WEBSOCKETS_HUMAN_TASK_CREATED="${{ env.TOPIC_CREATE_HUMAN_TASK }}"
export REACT_APP_NOVU_ENABLED="${{ env.NOVU_ENABLED }}"
export REACT_APP_NOVU_PUBLISHER_API_URL="${{ env.NOVU_PUBLISHER_API_URL }}"
yarn --cwd ${{ needs.checkout-repo.outputs.repo-path }}/apps/react/case-portal build
33 changes: 0 additions & 33 deletions .github/workflows/jarDeploy.yml

This file was deleted.

50 changes: 29 additions & 21 deletions .github/workflows/tags.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tags
name: Release - Build and Publish Docker Images

on:
push:
Expand All @@ -20,7 +20,8 @@ env:
NOVU_PUBLISHER_API_URL: http://localhost:3002

jobs:
build:

checkout:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -29,10 +30,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"
build-java:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Set up jdk 18
uses: actions/setup-java@v3
with:
Expand All @@ -44,16 +48,16 @@ jobs:
with:
maven-version: 3.8.2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build all for backend api
run: mvn -B package --file apps/java/pom.xml

build-react:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Install dependencies for case-portal
run: yarn --cwd apps/react/case-portal install

Expand All @@ -72,6 +76,19 @@ jobs:
export REACT_APP_NOVU_PUBLISHER_API_URL="${{ env.NOVU_PUBLISHER_API_URL }}"
yarn --cwd apps/react/case-portal build
build-docker-images:
steps:
- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down Expand Up @@ -132,15 +149,6 @@ jobs:
push: true
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ steps.extract_tag.outputs.tag }}"

- name: Build and push Docker image for case-portal
uses: docker/build-push-action@v2
with:
context: ./apps/react/case-portal
platforms: linux/amd64,linux/arm64
file: apps/react/case-portal/deployments/Dockerfile
push: true
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ steps.extract_tag.outputs.tag }}"

- name: Build and push Docker image for websocket-publisher
uses: docker/build-push-action@v2
with:
Expand Down
13 changes: 7 additions & 6 deletions apps/react/case-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@
"simplebar-react": "^3.2.4"
},
"scripts": {
"start": "webpack serve --mode=development --port 3001",
"build": "eslint --fix . && webpack --mode=production",
"test": "jest",
"lint": "eslint --fix .",
"format": "prettier --write \"**/*.{js,jsx,json,css,scss,md}\"",
"format:check": "prettier --check \"**/*.{js,jsx,json,css,scss,md}\""
"start": "echo 'Starting development server...' && webpack serve --mode=development --port 3001",
"build": "echo 'Running ESLint...' && eslint . && echo 'Checking code formatting...' && prettier --check \"**/*.{js,jsx,json,css,scss,md}\" && echo 'Building for production...' && webpack --mode=production",
"lint:fix": "echo 'Fixing linting issues...' && eslint --fix .",
"lint:check": "echo 'Checking for linting issues...' && eslint .",
"format:fix": "echo 'Fixing code formatting...' && prettier --write \"**/*.{js,jsx,json,css,scss,md}\"",
"format:check": "echo 'Checking code formatting...' && prettier --check \"**/*.{js,jsx,json,css,scss,md}\"",
"test": "echo 'Running tests...' && jest"
},
"babel": {
"presets": [
Expand Down
32 changes: 16 additions & 16 deletions apps/react/case-portal/src/SessionStoreContext.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import React, { useContext } from 'react';
import React, { useContext } from 'react'

const SessionStoreContext = React.createContext({});
export const SessionStoreProvider = SessionStoreContext.Provider;
export const SessionStoreConsumer = SessionStoreContext.Consumer;
const SessionStoreContext = React.createContext({})
export const SessionStoreProvider = SessionStoreContext.Provider
export const SessionStoreConsumer = SessionStoreContext.Consumer

export function withStore(WrappedComponent) {
function WithStoreComponent(props) {
return (
<SessionStoreConsumer>
{(stores) => <WrappedComponent {...props} {...stores} />}
</SessionStoreConsumer>
);
)
}
return WithStoreComponent;
return WithStoreComponent
}

export const useSession = () => {
const attrs = useContext(SessionStoreContext);
return attrs['keycloak'];
};
const attrs = useContext(SessionStoreContext)
return attrs['keycloak']
}

export const useMenu = () => {
const attrs = useContext(SessionStoreContext);
return attrs['menu'];
};
const attrs = useContext(SessionStoreContext)
return attrs['menu']
}

export const useBpmEngine = () => {
const attrs = useContext(SessionStoreContext);
return attrs['bpmEngine'];
};
const attrs = useContext(SessionStoreContext)
return attrs['bpmEngine']
}

export default SessionStoreContext;
export default SessionStoreContext
12 changes: 6 additions & 6 deletions apps/react/case-portal/src/assets/images/auth/AuthBackground.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// material-ui
import { useTheme } from '@mui/material/styles';
import { Box } from '@mui/material';
import { useTheme } from '@mui/material/styles'
import { Box } from '@mui/material'

// ==============================|| AUTH BLUR BACK SVG ||============================== //

const AuthBackground = () => {
const theme = useTheme();
const theme = useTheme()
return (
<Box
sx={{ position: 'absolute', filter: 'blur(18px)', zIndex: -1, bottom: 0 }}
Expand Down Expand Up @@ -33,7 +33,7 @@ const AuthBackground = () => {
/>
</svg>
</Box>
);
};
)
}

export default AuthBackground;
export default AuthBackground
2 changes: 1 addition & 1 deletion apps/react/case-portal/src/common/caseStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export const CaseStatus = {
WipCaseStatus: Symbol('WIP_CASE_STATUS'),
ClosedCaseStatus: Symbol('CLOSED_CASE_STATUS'),
ArchivedCaseStatus: Symbol('ARCHIVED_CASE_STATUS'),
};
}
10 changes: 5 additions & 5 deletions apps/react/case-portal/src/components/@extended/AnimateButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import PropTypes from 'prop-types'

// third-party
import { motion } from 'framer-motion';
import { motion } from 'framer-motion'

// ==============================|| ANIMATION BUTTON ||============================== //

Expand All @@ -15,15 +15,15 @@ export default function AnimateButton({ children, type }) {
<motion.div whileHover={{ scale: 1 }} whileTap={{ scale: 0.9 }}>
{children}
</motion.div>
);
)
}
}

AnimateButton.propTypes = {
children: PropTypes.node,
type: PropTypes.oneOf(['slide', 'scale', 'rotate']),
};
}

AnimateButton.defaultProps = {
type: 'scale',
};
}
Loading

0 comments on commit e12125f

Please sign in to comment.