forked from pac4j/pac4j
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 2.41 KB
/
ci.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
63
64
65
66
67
68
69
70
71
name: Java CI
env:
JDK_CURRENT: 17
DISTRIBUTION: zulu
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: Set up JDK
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.DISTRIBUTION }}
- name: Cache Maven dependencies
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B clean install
deploy:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: Set up JDK
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3
with:
java-version: ${{ env.JDK_CURRENT }}
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: ${{ env.DISTRIBUTION }}
- name: Deploy to Sonatype
run: mvn -B -DskipTests deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PWD }}
doc:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
needs: [deploy]
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: Set up JDK
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.DISTRIBUTION }}
- name: Generate and push doc
run: chmod -R 777 ./ci/*.sh && ./ci/push-doc-to-gh-pages.sh
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}