-
Notifications
You must be signed in to change notification settings - Fork 19
58 lines (49 loc) · 1.48 KB
/
m2.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
name: Deploy Maven artifacts
on: push
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
environment: m2 deployment
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up a compatible Java version
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
cache: maven
- name: Potentially restore node from cache
uses: actions/cache@v3
with:
path: |
frontend/node
key: node-${{ hashFiles('frontend/pom.xml') }}
restore-keys: node-
- name: Potentially restore npm dependencies from cache
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-
- name: Check out the m2 repository
uses: actions/checkout@v4
with:
ref: m2
path: m2
- name: Generate revision
id: revision
run: echo "revision=$(date +%Y.%m%d.%H%M%S)-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Build the artifacts
run: mvn clean deploy
--batch-mode
-DmaxWarnings=0
-DaltDeploymentRepository=m2::file:m2
-Drevision=${{ steps.revision.outputs.revision }}
- name: Deploy the artifacts to GitHub
uses: EndBug/add-and-commit@v9
with:
message: ${{ steps.revision.outputs.revision }}
cwd: m2