Skip to content

Prepayment period

Prepayment period #427

Workflow file for this run

name: Application CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
pipeline:
name: ERP System pipeline
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]')"
timeout-minutes: 40
env:
NODE_VERSION: 14.17.6
SPRING_OUTPUT_ANSI_ENABLED: DETECT
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
NG_CLI_ANALYTICS: false
ERP_SYSTEM_PROD_DB: "${{ secrets.ERP_SYSTEM_PROD_DB }}"
SPRING_DATA_JEST_URI: "${{ secrets.SPRING_DATA_JEST_URI }}"
ERP_SYSTEM_DEV_DB: "${{ secrets.ERP_SYSTEM_DEV_DB }}"
ERP_SYSTEM_PORT: "${{ secrets.ERP_SYSTEM_PORT }}"
PG_DATABASE_DEV_USER: "${{ secrets.PG_DATABASE_DEV_USER }}"
PG_DATABASE_PROD_USER: "${{ secrets.PG_DATABASE_PROD_USER }}"
PG_DATABASE_DEV_PASSWORD: "${{ secrets.PG_DATABASE_DEV_PASSWORD }}"
PG_DATABASE_PROD_PASSWORD: "${{ secrets.PG_DATABASE_PROD_PASSWORD }}"
LOCAL_PG_SERVER: "${{ secrets.LOCAL_PG_SERVER }}"
ERP_SYSTEM_DEV_PORT: "${{ secrets.ERP_SYSTEM_DEV_PORT }}"
ERP_SYSTEM_PROD_PORT: "${{ secrets.ERP_SYSTEM_PROD_PORT }}"
ERP_SYSTEM_PROD_MAIL_BASE_URL: "${{ secrets.ERP_SYSTEM_PROD_MAIL_BASE_URL }}"
ERP_SYSTEM_DEV_MAIL_BASE_URL: "${{ secrets.ERP_SYSTEM_DEV_MAIL_BASE_URL }}"
SECURITY_AUTHENTICATION_JWT_BASE64_SECRET: "${{ secrets.SECURITY_AUTHENTICATION_JWT_BASE64_SECRET }}"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.17.6
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17.x'
- name: Install node.js packages
run: npm install
- name: Run backend test
run: |
chmod +x mvnw
npm run ci:backend:test
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ERP-System-Contributors_erp-system
- name: Login to Docker hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image
run: ./mvnw -ntp package jib:dockerBuild -Pprod -DskipTests
- name: Publish image
run: docker push ghacupha/erp-system:1.7.9
- name: Build and Publish Elasticsearch image
uses: docker/build-push-action@v2
with:
context: .
file: src/main/docker/ESDockerfile
push: true
tags: ghacupha/erp-system-elastic-search:1.7.9