-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (116 loc) · 3.99 KB
/
checkstyle.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
env:
AWS_REGION: ap-northeast-2
SPRING_PROFILES_ACTIVE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
jobs:
build:
runs-on: ubuntu-20.04
outputs:
PROJECT_NAME: ${{ steps.set-env.outputs.PROJECT_NAME }}
PROJECT_VERSION: ${{ steps.set-env.outputs.PROJECT_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Test profile
run: echo $SPRING_PROFILES_ACTIVE
- uses: keithweaver/[email protected] # Verifies the recursive flag
name: sync folder
with:
command: sync
source: ${{ secrets.S3_BUCKET }}
destination: ./src/main/resources/
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'corretto'
java-package: 'jdk'
- name: Cache Gradle modules
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Check style
run: ./gradlew checkstyle
- name: Test with Gradle
run: ./gradlew test
#
# - name: Build with Gradle
# run: ./gradlew build
#
# - name: Set PROJECT_NAME and PROJECT_VERSION from Gradle
# id: set-env
# run: |
# echo "PROJECT_NAME=$(./gradlew properties | grep '^name:' | awk '{print $2}')" >> "$GITHUB_OUTPUT"
# echo "PROJECT_VERSION=$(./gradlew properties | grep '^version:' | awk '{print $2}')" >> "$GITHUB_OUTPUT"
# shell: bash
#
# - name: Archive artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.set-env.outputs.PROJECT_NAME }}-${{ steps.set-env.outputs.PROJECT_VERSION }}
# path: |
# build/libs/${{ steps.set-env.outputs.PROJECT_NAME }}-${{ steps.set-env.outputs.PROJECT_VERSION }}.jar
# Dockerfile
# retention-days: 1
# release:
# needs: build
# if: contains(github.event.pull_request.labels.*.name, 'release')
# runs-on: ubuntu-20.04
# env:
# PROJECT_NAME: ${{ needs.build.outputs.PROJECT_NAME }}
# PROJECT_VERSION: ${{ needs.build.outputs.PROJECT_VERSION }}
# DIR_NAME: ${{ needs.build.outputs.PROJECT_NAME }}-${{ needs.build.outputs.PROJECT_VERSION }}
#
# steps:
# - name: Download Artifacts
# uses: actions/download-artifact@v3
#
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ env.AWS_REGION }}
#
# - name: Login to ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
#
# - name: test
# working-directory: ${{ env.DIR_NAME }}
# run: |
# ls -al && cat Dockerfile
#
# - name: Build and Push
# id: build-push
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./${{ env.DIR_NAME }}/Dockerfile
# push: true
# tags: |
# ${{ env.ECR_REGISTRY }}/${{ secrets.ECR_REPOSITORY }}:latest
# ${{ env.ECR_REGISTRY }}/${{ secrets.ECR_REPOSITORY }}:${{env.PROJECT_VERSION}}
# build-args: |
# jarFile=${{ env.DIR_NAME }}/build/libs/${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}.jar