This repository was archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.37 KB
/
Copy pathdocs.yml
File metadata and controls
78 lines (67 loc) · 2.37 KB
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
name: Build docs and deploy to GitHub Pages
on:
workflow_dispatch:
workflow_call:
secrets:
MYSQL_PASSWORD:
required: true
SPRING_APPLICATION_PROPERTIES:
required: true
VERNITE_2022_PRIVATE_KEY_PEM:
required: true
CODECOV_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v3
# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: maven
# Install and configure MySQL
- name: Install and configure MySQL
run: |
sudo systemctl start mysql.service
mysql -h 127.0.0.1 -uroot -proot -e 'create database vernite charset utf8mb4'
mysql -h 127.0.0.1 -uroot -proot -e 'create database vernite_test charset utf8mb4'
mysql -h 127.0.0.1 -uroot -proot -e 'create user "vernite"@"localhost" identified by "${{ secrets.MYSQL_PASSWORD }}"'
mysql -h 127.0.0.1 -uroot -proot -e 'grant all on *.* to "vernite"@"localhost" with grant option'
# Install properties secrets
- name: Install properties
run: 'echo "$SPRING_APPLICATION_PROPERTIES" > application.properties'
env:
SPRING_APPLICATION_PROPERTIES: ${{ secrets.SPRING_APPLICATION_PROPERTIES }}
# Prepare secret for signing JWT
- name: Prepare secret
run: |
echo "${{ secrets.VERNITE_2022_PRIVATE_KEY_PEM }}" > key.pem
openssl pkcs8 -topk8 -inform pem -in key.pem -out "vernite-2022.private-key.der" -outform der -nocrypt
# Download cache
- name: Download cache
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-build-${{ github.run_id }}
# Build javadoc and jacoco
- name: Generate Javadoc & Jacoco
run: mvn jacoco:report javadoc:javadoc
# Upload code coverage
- name: Generate code coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/site/jacoco/jacoco.xml
# Deploy to GitHub Pages
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: target/site
single-commit: true