You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
# 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: Java CI with Maven
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Set up JDK 1.8
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '1.8'
|
|
- name: Build with Maven
|
|
run: mvn -B package --file pom.xml
|
|
# 通过 Dockerfile 构建镜像
|
|
- name: Build docker image
|
|
run: docker build . -t demo_actions:v1.0
|
|
|
|
# 登陆到我们自己的 docker registry
|
|
- name: Login to aliyun docker image registry
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login --username=shangguanyize registry.cn-hangzhou.aliyuncs.com --password-stdin
|
|
|
|
# 上传 docker 镜像
|
|
- name: Push image to aliyun docker image registry
|
|
run: docker push demo_actions:v1.0
|
|
|