build_java
This commit is contained in:
52
.github/workflows/build_java.yml
vendored
Normal file
52
.github/workflows/build_java.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
maven-version:
|
||||
required: true
|
||||
type: string
|
||||
java-version:
|
||||
required: true
|
||||
type: string
|
||||
artifact-name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build_java_project:
|
||||
runs-on: ubuntu_act_on_20
|
||||
# container:
|
||||
# image: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v5
|
||||
with:
|
||||
maven-version: ${{ inputs.maven-version }}
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '${{ inputs.java-version }}'
|
||||
# cache: 'maven'
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-
|
||||
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-maven-
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn --batch-mode package --file pom.xml -Dhttps.proxyHost=act_clash -Dhttps.proxyPort=7890 -Dhttp.proxyHost=act_clash -Dhttp.proxyPort=7890
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: |
|
||||
target
|
||||
docker
|
||||
10
.github/workflows/publish_docker.yml
vendored
10
.github/workflows/publish_docker.yml
vendored
@@ -6,6 +6,12 @@ on:
|
||||
artifact-name:
|
||||
required: true
|
||||
type: string
|
||||
docker_context:
|
||||
required: true
|
||||
type: string
|
||||
dockerfile_path:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
|
||||
jobs:
|
||||
@@ -59,8 +65,8 @@ jobs:
|
||||
http_proxy=http://192.168.0.20:7890
|
||||
https_proxy=http://192.168.0.20:7890
|
||||
version=${{ steps.meta.outputs.REPO_VERSION }}
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
context: ${{ inputs.docker_context }}
|
||||
file: ${{ inputs.dockerfile_path }}
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
|
||||
Reference in New Issue
Block a user