-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (29 loc) · 910 Bytes
/
build.yaml
File metadata and controls
34 lines (29 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: 'Build and Push Docker Image'
on:
push:
branch: [ main ]
tags: [ 'v*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Build
run: ./gradlew clean build -x test --no-daemon
- name: Build and Push Docker Image
env:
image: ${{ secrets.ALIYUN_DOCKER_NAMESPACE }}/cloudapi
tags: ${{ github.ref_name }}
registry: ${{ secrets.ALIYUN_DOCKER_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKER_USERNAME }}
password: ${{ secrets.ALIYUN_DOCKER_PASSWORD }}
run: |
docker login ${registry} -u ${username} -p ${password}
docker build -t ${image}:${tags} .
docker push ${image}:${tags}