Skip to content

Merge pull request #17 from hango-io/trickMin-patch-1 #48

Merge pull request #17 from hango-io/trickMin-patch-1

Merge pull request #17 from hango-io/trickMin-patch-1 #48

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Docker Build
on:
push:
branches:
- main
- release-*
tags:
- 'v*'
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_HUB_USERNAME }}/api-plane
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
file: ./hango-api-plane-server/Dockerfile
# 所需要的体系结构,可以在 Available platforms 步骤中获取所有的可用架构
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}