name:GitHub Pageson:push:branches:- main # Set a branch to deploypull_request:jobs:deploy:runs-on:ubuntu-22.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:- uses:actions/checkout@v4with:submodules:true# Fetch Hugo themes (true OR recursive)fetch-depth:0# Fetch all history for .GitInfo and .Lastmod- name:Setup Hugouses:peaceiris/actions-hugo@v2with:hugo-version:'0.119.0'# extended: true- name:Buildrun:hugo --minify- name:Deployuses:peaceiris/actions-gh-pages@v3if:github.ref == 'refs/heads/main'with:github_token:${{ secrets.GITHUB_TOKEN }}publish_dir:./public
name:Java CI with Mavenon:push:branches:["main"]pull_request:branches:["main"]jobs:build:runs-on:ubuntu-lateststeps:- uses:actions/checkout@v4- name:Set up JDK 20uses:actions/setup-java@v3with:java-version:'20'distribution:'temurin'cache:maven- name:Build with Mavenrun:mvn -B package --file pom.xml -DskipTests# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive- name:Update dependency graphuses:advanced-security/maven-dependency-submission-action@fcd7eab6b6d22946badc98d1e62665cdee93e0ae- name:Transfer html filesuses:Dylan700/sftp-upload-action@latestwith:server:${{ secrets.HOST }}username:${{ secrets.USERNAME }}port:22key:${{ secrets.PRIVATEKEY }}uploads:| ./target/app.jar => ${{ secrets.REMOTEPATH }}delete:'true'- name:restart server throuth sshuses:appleboy/ssh-action@masterwith:host:${{ secrets.HOST }}username:${{ secrets.USERNAME }}key:${{ secrets.PRIVATEKEY }}script:| cd ${{ secrets.DEPLOYPATH }}
./restart.sh