更新 .gitea/workflows/dev.yml
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m20s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m20s
This commit is contained in:
parent
79d55e458f
commit
f9a7990de9
@ -1,52 +1,65 @@
|
|||||||
name: Gitea Actions Demo
|
name: Gitea Actions Demo
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
|
# env:
|
||||||
|
# HTTP_PROXY: http://192.168.1.219:7890
|
||||||
|
# HTTPS_PROXY: http://192.168.1.219:7890
|
||||||
|
# NO_PROXY: localhost,127.0.0.1
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
uses: actions/checkout@v4 # 拉取代码到工作目录
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1 # 只拉取最新一次提交
|
java-version: '17'
|
||||||
- name: Maven
|
distribution: 'temurin'
|
||||||
run: mvn clean install
|
cache: maven
|
||||||
- name: Build with Maven
|
# - name: Cache Maven dependencies
|
||||||
run: mvn -B package -DskipTests -pl ruoyi-modules/Property -am
|
# uses: actions/cache@v3
|
||||||
- name: cp
|
# with:
|
||||||
run: copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server
|
# path: ~/.m2/repository
|
||||||
- name: kill
|
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
run: Get-NetTCPConnection -LocalPort 10001 -State Listen -ErrorAction SilentlyContinue | Where-Object { $_.OwningProcess -ne $null } | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue }
|
# restore-keys: |
|
||||||
- name: run
|
# ${{ runner.os }}-maven-
|
||||||
run: java -jar C:\devtool\server\Property.jar
|
- name: Set up Maven
|
||||||
|
uses: stCarolas/setup-maven@v5
|
||||||
|
with:
|
||||||
|
maven-version: 3.8.2
|
||||||
|
|
||||||
# - copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server
|
- name: List files in the repository
|
||||||
# - pwd
|
run: |
|
||||||
# - java -jar ./docker/jar/Property.jar
|
ls ${{ gitea.workspace }}
|
||||||
|
# - name: Set up JDK
|
||||||
# - name: cd
|
# uses: actions/setup-java@v3
|
||||||
# run: cd ruoyi-modules/Property
|
# with:
|
||||||
# - name: Build with Maven
|
# java-version: '17'
|
||||||
# run: mvn -B clean package -DskipTests --file pom.xml
|
# distribution: 'temurin'
|
||||||
|
# - name: Build with Maven
|
||||||
# - name: Start Spring Cloud Services
|
# run: mvn clean package
|
||||||
# run: |
|
- name: Install dependencies
|
||||||
# # 启动顺序示例:注册中心 -> 配置中心 -> 网关 -> 业务服务
|
run: mvn clean package -DskipTests
|
||||||
# echo "Starting Server..."
|
- name: copy file via ssh password
|
||||||
# java -jar Property.jar
|
uses: appleboy/scp-action@v0.1.7
|
||||||
# SERVER_PIDS[0]=$!
|
with:
|
||||||
|
host: 192.168.1.3
|
||||||
# # 等待注册中心启动
|
username: root
|
||||||
# sleep 30
|
password: by@2025!
|
||||||
|
port: 22
|
||||||
|
source: "RuoYi-Cloud-Plus/ruoyi-modules/Property/target/Property.jar,RuoYi-Cloud-Plus/ruoyi-modules/Property/docker-compose.yml,Dockerfile"
|
||||||
|
target: "/home/runner/plus/"
|
||||||
|
- name: Deploy to server via SSH
|
||||||
|
uses: appleboy/ssh-action@v0.1.7
|
||||||
|
with:
|
||||||
|
host: 192.168.1.220
|
||||||
|
username: root
|
||||||
|
password: 2003moc
|
||||||
|
port: 22
|
||||||
|
script: |
|
||||||
|
cd /home/runner/plus
|
||||||
|
docker-compose up -d --force-recreate
|
||||||
|
|
||||||
|
|
||||||
# done
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|
||||||
# 保持工作流运行,避免服务被终止
|
|
||||||
# wait
|
|
||||||
# env:
|
|
||||||
# JAVA_OPTS: "-Xmx512m -Xms256m"
|
|
||||||
# timeout-minutes: 20
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user