mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +08:00
build: 增加 GitHub action
This commit is contained in:
parent
bf13f09322
commit
ad72116159
36
.github/workflows/build-push.yml
vendored
Normal file
36
.github/workflows/build-push.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: Build Docker Image and Push
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: nelonoel/branch-name@v1.0.1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Docker Setup Buildx
|
||||
uses: docker/setup-buildx-action@v1.0.3
|
||||
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v1.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Build Docker Image
|
||||
uses: docker/build-push-action@v2.2.0
|
||||
with:
|
||||
build-args: MS_VERSION=${BRANCH_NAME}-b${GITHUB_RUN_NUMBER}
|
||||
tags: metersphere/metersphere:${BRANCH_NAME}
|
Loading…
Reference in New Issue
Block a user