-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 1.87 KB
/
stag-build.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build for Stage
on:
push:
branches:
- main
env:
SERVICE_NAME: dms
SERVICE_TYPE: be
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11 ]
outputs:
version: ${{ steps.get_version.outputs.BRANCH_NAME }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3
- 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 ECR
id: ecr
uses: elgohr/ecr-login-action@master
with:
access_key: ${{ secrets.AWS_ACCESS_KEY }}
secret_access_key: ${{ secrets.AWS_SECRET_KEY }}
region: ${{ secrets.AWS_REGION }}
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{env.SERVICE_NAME}}-${{env.SERVICE_TYPE}}
username: ${{ steps.ecr.outputs.username }}
password: ${{ steps.ecr.outputs.password }}
registry: ${{ steps.ecr.outputs.registry }}
tags: ${{ github.sha }}
buildargs: |
PROFILE=stag
CLOUD_CONFIG_USERNAME=${{ secrets.CLOUD_CONFIG_USERNAME }}
CLOUD_CONFIG_PASSWORD=${{ secrets.CLOUD_CONFIG_PASSWORD }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GITOPS_DEPLOY_STAGE_TOKEN }}
repository: team-xquare/xquare-gitops-repo-staging
event-type: update_image
client-payload: '{"ref": "${{ github.ref }}",
"version": "${{ github.sha }}",
"service_name": "${{env.SERVICE_NAME}}",
"service_type": "${{env.SERVICE_TYPE}}" }'