Skip to content

auto

auto #1186

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: auto
on:
schedule:
- cron: '0 0 * * *'
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: "SSH connection to Actions"
required: false
default: "false"
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: run application
run: java -jar build/libs/wallpaper-1.0-SNAPSHOT.jar
- name: Commit file to github
run: |
git config --local user.email "[email protected]"
git config --local user.name "JiaWei Lee"
git add images/4k_**
git add images/bing_**
git add index.txt
git add *.json
git add *.md
git add *.db
git commit -m "auto update wallpaper"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.MY_GIT_TOKEN }}
branch: main