mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 10:52:26 +00:00
Update maven.yml
This commit is contained in:
57
.github/workflows/maven.yml
vendored
57
.github/workflows/maven.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest # 运行环境
|
||||
steps:
|
||||
- name: checkout code
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
# https://github.com/actions/setup-java
|
||||
- name: install JDK17
|
||||
@@ -35,56 +35,39 @@ jobs:
|
||||
# https://github.com/arduino/setup-protoc
|
||||
- name: Install Protoc
|
||||
uses: arduino/setup-protoc@v3
|
||||
# 直接本地打包好jar包,然后上传到服务器?
|
||||
|
||||
- name: Maven build
|
||||
run: |
|
||||
mvn clean
|
||||
mvn -B -DskipTests=true install --file pom.xml
|
||||
cd starter
|
||||
mvn -B -DskipTests=true package --file pom.xml
|
||||
# 提取 Git 标签
|
||||
- name: Extract Git tag
|
||||
id: extract_tag
|
||||
run: echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
|
||||
# https://github.com/docker/login-action
|
||||
- name: login to docker hub
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
username: bytedesk
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Login to Aliyun Docker
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIYUN_DOCKER_USERNAME }}
|
||||
password: ${{ secrets.ALIYUN_DOCKER_PASSWORD }}
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Create and use a new builder
|
||||
run: |
|
||||
docker buildx create --use --name mybuilder
|
||||
docker buildx inspect mybuilder --bootstrap
|
||||
# 构建并推送 Docker 镜像到 Docker Hub
|
||||
|
||||
# https://hub.docker.com/r/bytedesk/bytedesk
|
||||
- name: Build and push Docker image to Docker Hub
|
||||
# https://cr.console.aliyun.com/repository/cn-hangzhou/bytedesk/bytedesk/images
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./starter # 确保构建上下文路径正确
|
||||
file: ./starter/Dockerfile # 确保 Dockerfile 文件路径正确
|
||||
context: ./starter
|
||||
file: ./starter/Dockerfile
|
||||
push: true
|
||||
tags: bytedesk/bytedesk-ce:latest
|
||||
# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/bytedesk:${{ env.TAG }} # 自动设置为当前的 Git 标签
|
||||
# https://hub.docker.com/_/eclipse-temurin
|
||||
# eclipse-temurin:17-jdk暂时不支持更多架构,暂时渠道:windows/arm64,macos/amd64,macos/arm64,windows/amd64
|
||||
tags: |
|
||||
bytedesk/bytedesk-ce:latest
|
||||
registry.cn-hangzhou.aliyuncs.com/bytedesk/bytedesk-ce:latest
|
||||
platforms: linux/amd64,linux/arm64,windows/amd64
|
||||
# 登录阿里云 Docker
|
||||
# https://registry.cn-hangzhou.aliyuncs.com/bytedesk/bytedesk:latest
|
||||
- name: login to aliyun docker
|
||||
run: echo ${{ secrets.ALIYUN_DOCKER_PASSWORD }} | docker login --username ${{ secrets.ALIYUN_DOCKER_USERNAME }} --password-stdin registry.cn-hangzhou.aliyuncs.com
|
||||
# 构建并推送 Docker 镜像到阿里云
|
||||
- name: Build and push Docker image to Aliyun
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./starter # 确保构建上下文路径正确
|
||||
file: ./starter/Dockerfile # 确保 Dockerfile 文件路径正确
|
||||
push: true
|
||||
tags: registry.cn-hangzhou.aliyuncs.com/bytedesk/bytedesk-ce:latest
|
||||
# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/bytedesk:${{ env.TAG }} # 自动设置为当前的 Git 标签
|
||||
# https://hub.docker.com/_/eclipse-temurin
|
||||
# eclipse-temurin:17-jdk暂时不支持更多架构,暂时渠道:windows/arm64,macos/amd64,macos/arm64,windows/amd64
|
||||
platforms: linux/amd64,linux/arm64,windows/amd64
|
||||
Reference in New Issue
Block a user