-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (54 loc) · 2.11 KB
/
jhipsterCiCd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: JHipster CI/CD Pipeline
on:
push:
branches:
- main
paths:
- 2_supplychain/2_praxis/DemoApplication/app/**
pull_request:
branches: [ "**" ]
paths:
- 2_supplychain/2_praxis/DemoApplication/app/**
workflow_dispatch:
jobs:
pipeline:
name: app 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: 18.18.2
SPRING_OUTPUT_ANSI_ENABLED: DETECT
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
NG_CLI_ANALYTICS: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.18.2
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Install node.js packages
run: npm install
working-directory: ./2_supplychain/2_praxis/DemoApplication/app/
- name: Run backend test
run: |
chmod +x mvnw
npm run ci:backend:test
working-directory: ./2_supplychain/2_praxis/DemoApplication/app/
- name: Run frontend test
run: npm run ci:frontend:test
working-directory: ./2_supplychain/2_praxis/DemoApplication/app/
- name: Package application
run: npm run java:jar:prod
working-directory: ./2_supplychain/2_praxis/DemoApplication/app/
- name: Build and publish docker image
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
GIT_TAG=:${GITHUB_REF#refs/tags/}
DOCKER_TAG=${GIT_TAG#:refs/heads/main}
./mvnw -ntp jib:build -Djib.to.image=ntdominikpabst/hipsterapp${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}" -Pprod
working-directory: ./2_supplychain/2_praxis/DemoApplication/app/