-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (47 loc) · 1.44 KB
/
main.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: CC-Visualizer
on:
push:
branches: [ main ]
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
stats-generation:
runs-on: ubuntu-latest
steps:
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v2
- name: Print Run ID
run: echo "Run ID:$GITHUB_RUN_ID"
- name: Print Git SHA
run: echo "Git SHA:$GITHUB_SHA"
# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
# Cache dependencies
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Build the Java project with Maven
- name: Build with Maven
run: mvn -B clean install --file ./pom.xml
# Generate all statistics images
- name: Generate images
run: mvn spring-boot:run
# Commit all changed files to the repository
- name: Commit to the repo
run: |
git config --global user.name gaurish
git config --global user.email [email protected]
git add .
# Force the build to succeed, even if no files were changed
git commit -m 'Update generated files' || true
git push