fix(ci): 使用 maven 容器镜像,移除手动安装依赖

This commit is contained in:
2026-07-19 20:56:30 +08:00
parent 2d87b96a09
commit 6cc5212eba
+2 -7
View File
@@ -19,18 +19,14 @@ env:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: maven:3.9-eclipse-temurin-17
steps: steps:
- name: Checkout code - name: Checkout code
run: | run: |
git clone $REPO_URL . git clone $REPO_URL .
git checkout ${{ gitea.sha }} git checkout ${{ gitea.sha }}
- name: Set up JDK 17
run: |
/usr/bin/apt-get update -qq
/usr/bin/apt-get install -y -qq openjdk-17-jdk
java -version
- name: Build with Maven - name: Build with Maven
run: ./mvnw package -DskipTests -B run: ./mvnw package -DskipTests -B
@@ -40,7 +36,6 @@ jobs:
- name: Build & Push Docker image - name: Build & Push Docker image
run: | run: |
/usr/bin/apt-get install -y -qq docker.io
TAG=${{ gitea.sha }} TAG=${{ gitea.sha }}
docker build -t $REGISTRY/$APP:$TAG -t $REGISTRY/$APP:${{ inputs.environment }} . docker build -t $REGISTRY/$APP:$TAG -t $REGISTRY/$APP:${{ inputs.environment }} .
docker push $REGISTRY/$APP:$TAG docker push $REGISTRY/$APP:$TAG