-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.3 KB
/
CD.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CD
on:
push:
branches:
- main
- "hotfix/**"
- "feature/**"
- "release/**"
jobs:
build:
environment: prod
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11 ]
outputs:
version: ${{ steps.get_version.outputs.BRANCH_NAME }}
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: Gradle Build
uses: gradle/gradle-build-action@v2
with:
arguments: |
build
--no-daemon
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Get branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr /# -)" >> $GITHUB_ENV
- name: Build and push to Github Container Registry
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/team-xquare/v1-service-dms:latest
ghcr.io/team-xquare/v1-service-dms:${{ env.BRANCH_NAME }}