SmartParks/.gitea/workflows/dev.yml
bichangxiong 86939591f5
Some checks failed
/ build-and-push (ruoyi-gateway) (push) Failing after 22s
/ build-and-push (ruoyi-modules/Property) (push) Failing after 22s
/ build-and-push (ruoyi-modules/Sis) (push) Failing after 22s
/ build-and-push (ruoyi-modules/ruoyi-job) (push) Waiting to run
/ build-and-push (ruoyi-modules/ruoyi-resource) (push) Waiting to run
/ build-and-push (ruoyi-modules/ruoyi-system) (push) Waiting to run
/ build-and-push (ruoyi-modules/ruoyi-workflow) (push) Waiting to run
/ build-and-push (ruoyi-seata-server) (push) Waiting to run
/ build-and-push (ruoyi-sentinel-dashboard) (push) Waiting to run
/ build-and-push (ruoyi-snailjob-server) (push) Waiting to run
/ build-and-push (ruoyi-visual/ruoyi-monitor) (push) Waiting to run
/ build-and-push (ruoyi-visual/ruoyi-nacos) (push) Waiting to run
/ build-and-push (ruoyi-auth) (push) Has been cancelled
/ build-and-push (ruoyi-modules/ruoyi-gen) (push) Has been cancelled
更新 .gitea/workflows/dev.yml
2025-08-14 00:43:20 +08:00

85 lines
2.8 KiB
YAML

run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
push:
branches:
- master # 监听master分支
jobs:
build-and-push:
runs-on: ubuntu
strategy:
matrix:
service:
- ruoyi-auth
- ruoyi-gateway
- ruoyi-modules/Property
- ruoyi-modules/ruoyi-gen
- ruoyi-modules/ruoyi-job
- ruoyi-modules/ruoyi-resource
- ruoyi-modules/ruoyi-system
- ruoyi-modules/ruoyi-workflow
- ruoyi-modules/Sis
- ruoyi-visual/ruoyi-monitor
- ruoyi-visual/ruoyi-nacos
- ruoyi-seata-server
- ruoyi-sentinel-dashboard
- ruoyi-snailjob-server
steps:
- name: Set up Node.js
uses: http://git.missmoc.top/mocheng/setup-node@v3
with:
node-version: '16' # 指定需要的 Node.js 版本
- name: Checkout Repository
uses: http://git.missmoc.top/mocheng/checkout@v4
# - name: Set Up JDK
# uses: http://git.missmoc.top/mocheng/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
- name: use JDK
run: |
echo "JAVA_HOME=/java17/java17" >> $GITHUB_ENV
echo "$JAVA_HOME/bin" >> $GITHUB_PATH
echo "MAVEN_HOME=/maven/apache-maven-3.9.11" >> $GITHUB_ENV
echo "$MAVEN_HOME/bin" >> $GITHUB_PATH
- name: test jdk
run: |
java -version
# 检查 JAVA_HOME 环境变量
echo "JAVA_HOME: $JAVA_HOME"
ls $MAVEN_HOME/bin/mvn
$MAVEN_HOME/bin/mvn -v
- name: Build Project with Maven
run: mvn clean package -DskipTests -f ./${{ matrix.service }}/pom.xml
- name: Set Up Docker Buildx
uses: http://git.missmoc.top/mocheng/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: http://git.missmoc.top/mocheng/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASS }}
- name: Determine Dockerfile Path
id: dockerfile-path
run: |
if [ "${{ matrix.service }}" = "ruoyi-visual/ruoyi-nacos" ]; then
echo "dockerfile_path=./ruoyi-visual/ruoyi-nacos/Dockerfile" >> $GITHUB_OUTPUT
else
echo "dockerfile_path=./${{ matrix.service }}/Dockerfile" >> $GITHUB_OUTPUT
fi
- name: Build and Push Docker Image
uses: http://git.missmoc.top/mocheng/build-push-action@v5
with:
context: .
file: ${{ steps.dockerfile-path.outputs.dockerfile_path }}
tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:${{ github.sha }}
push: true