Skip to content

Java CI with Maven #388

Java CI with Maven

Java CI with Maven #388

Workflow file for this run

# 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: Java CI with Maven
on:
# push:
# # 在push main分支时触发
# branches:
# - main
schedule:
# * is a special character in YAML so you have to quote this string
#分钟、小时、日、月、周 UTC时间每天凌晨1点左右,UTC+8对应时间为早上9点左右
- cron: '0 1 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: current date
run: date
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Run Java Application
run: java -jar target/bing-wallpaper-jar-with-dependencies.jar
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "halo"
git pull
git add README.md
git add bing-wallpaper.md
git add picture/* || true
git add docs/* || true
git add zh-cn/* || true
git commit -m "update readme.md"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ACTIONS_TOKEN }}
branch: main