-
Notifications
You must be signed in to change notification settings - Fork 25
106 lines (90 loc) · 3.05 KB
/
release.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release CI
on:
push:
tags:
- v*
env:
GPG_EXECUTABLE: ${{ secrets.GPG_EXECUTABLE }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
XS2A_ADAPTER_IMAGE_NAME: xs2a-adapter
XS2A_ADAPTER_ORGANIZATION_NAME: adorsys
jobs:
build-and-push-to-dockerhub:
name: Build and push image to Dockerhub
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build project
run: mvn clean package -Dmaven.test.skip=true -B
- name: Login to Docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get project version
run: echo "DOCKER_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Build and push to Dockerhub
uses: docker/build-push-action@v2
env:
DOCKERHUB_IMAGE_NAME: ${{ env.XS2A_ADAPTER_ORGANIZATION_NAME }}/${{ env.XS2A_ADAPTER_IMAGE_NAME }}:${{ env.DOCKER_TAG }}
with:
context: .
push: true
tags: ${{ env.DOCKERHUB_IMAGE_NAME }}
build:
name: Publish project artifacts to Maven Central
needs: build-and-push-to-dockerhub
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build & Publish
run: |
export GPG_TTY="$( tty )"
echo ${{ secrets.GPG_SECRET_KEY }} | base64 --decode | gpg --import --batch --yes
echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --batch --import-ownertrust --yes
mvn -ntp --settings scripts/mvn-release-settings.xml \
-Dhttp.keepAlive=false \
-Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \
-Prelease -DskipTests -B -U deploy
shell: bash
build-and-deploy-docs:
name: Build and deploy documentation
needs: build
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- run: chmod +x docs-generator.sh
- name: Generate Website
run: ./docs-generator.sh
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tmp