-
Notifications
You must be signed in to change notification settings - Fork 58
42 lines (37 loc) · 1.52 KB
/
Copy pathGithubPagesReport.yml
File metadata and controls
42 lines (37 loc) · 1.52 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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Github Pages Report
on:
push:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v6.0.0
with:
java-version: 21
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v6
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: |
mvn install:install-file -DgroupId="com.harukizaemon.simian" -DartifactId="simian" -Dversion="2.5.10" -Dpackaging=”jar” -Dfile="lib/simian-2.5.10.jar"
mvn clean package site
- name: Push to github pages
run: |
cd ./target/site
git config --global user.name "AloysHF"
git config --global user.email "jiangxinnju@163.com"
git init
git add .
git commit -m "update gh-pages"
# Sometimes if this github actions is triggered multiple times in a short period, the push may fail due to conflicts
# So we just ignore the error here and try to push again next time
git push -f https://AloysHF:${{secrets.GITHUB_TOKEN}}@github.com/AloysHF/ApkToolBoxGUI.git master:gh-pages || echo "Git push failed: $?"