-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (62 loc) · 1.9 KB
/
build.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
55
56
57
58
59
60
61
62
name: Build
on:
push:
branches-ignore:
- development
- test
- master
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get build commit hash
run: |
export BUILD_COMMIT_HASH=$(git rev-parse HEAD)
echo $BUILD_COMMIT_HASH
sed -i "s/\"buildHash\": \".*\"/\"buildHash\": \"$BUILD_COMMIT_HASH\"/" mdm-frontend/src/assets/config.json
cat mdm-frontend/src/assets/config.json
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Cache maven artifacts
uses: actions/cache@v3
env:
cache-name: cache-maven-artifacts
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Install MDM Maven plugin
shell: bash
run: mvn -f maven-plugin/pom.xml install
- name: Set up node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mdm-frontend/package-lock.json') }}
- name: Extract branch name
shell: bash
run: echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Build with Maven
run: ./deploy/build.sh unused ${{ env.BRANCH }}
env:
REPO_GITHUB_USERNAME: ${{ secrets.REPO_GITHUB_USERNAME }}
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
- name: Report build status via Slack
uses: act10ns/slack@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}