-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 2.05 KB
/
github-actions.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: Application CI
on: [push, pull_request]
jobs:
validation:
name: 'Gradle Wrapper Validation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
pipeline:
name: teamDojo 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: 16.14.0
SPRING_OUTPUT_ANSI_ENABLED: DETECT
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
NG_CLI_ANALYTICS: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.14.0
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
# ### MODIFICATION-START ###
java-version: 17
# ### MODIFICATION-END ###
- name: Install node.js packages
run: npm install
- name: Run backend test
run: |
chmod +x gradlew
npm run ci:backend:test
- name: Run frontend test
run: npm run ci:frontend:test
- name: Package application
run: |
# The clean is necessary to prevent Java compile errors. Reason unknown yet.
./gradlew clean
npm run java:jar:prod
- 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}
# ### Modification-Start ###
# temporary tag override
DOCKER_TAG=":2.1.0-alpha1"
# ### Modification-End ###
./gradlew jib -Djib.to.image=docker.io/iteratec/teamdojo${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}"