-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (40 loc) · 1.27 KB
/
build-deploy.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
# Build & Deploy on Tag & Push
name: Github Package
on:
push:
tags:
["v*.*.*", "v*.*.*-*"]
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master"]
pull_request:
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master"]
jobs:
build-deploy-github:
name: Build & Deploy to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
server-id: github
server-username: GITHUB_USERNAME
server-password: GITHUB_TOKEN
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Extract version from pom.xml
id: version
run: |
echo ::set-output name=VERSION::$(grep -A 1 '<artifactId>utils</artifactId>' pom.xml | grep -oP '(?<=<version>).*?(?=</version>)')
- name: Deploy
run: mvn clean install -Pgithub deploy
env:
GITHUB_USERNAME: ${{ secrets.USERNAME }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}