Java CI with Maven #418
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with Maven | |
on: | |
schedule: | |
- cron: '30 17 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 21 | |
- 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 "${{ secrets.EMAIL }}" | |
git config --local user.name "${{ secrets.NAME }}" | |
git pull | |
git add README.md | |
git add bing-wallpaper.md | |
git add picture/* | |
git add docs/* | |
git commit -m "update readme.md" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.MY_GITHUB_TOKEN }} | |
branch: main |