🚀 [feature] Continuous Deployment 구현 #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name : 풀 리퀘스트 Gradle 빌드 테스트 | |
on: | |
pull_request: | |
types: [opened, reopen, synchronize, closed] | |
permissions: read-all | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3.0.2 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
application: | |
- 'build.gradle' | |
- 'src/**' | |
- name: JDK 설치 | |
if: steps.changes.outputs.application == 'true' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 11 | |
cache: 'gradle' | |
- name: gradlew 권한 부여 | |
run: chmod +x ./gradlew | |
- name: Gradle Build | |
if: steps.changes.outputs.application == 'true' | |
env: | |
JASYPT_ENCRYPTION_PASSWORD: ${{ secrets.PROPERTY_ENCRYPTION_PASSWORD }} | |
run: | | |
./gradlew build --no-build-cache | |
- name: All Error Report Files 압축 | |
if: ${{ failure() }} | |
run: | | |
echo "All Error Report Files 압축" | |
TIMESTAMP=$(date +%Y%m%d_%H%M%S) | |
mkdir error_report_files | |
REPORT_DIRS=$(find . -type d -path '*/build/reports/tests/test') | |
for dir in $REPORT_DIRS; do | |
module_path=$(echo $dir | awk -F'/build/' '{print $1}' | cut -c 3-) | |
cp -r $dir error_report_files/$module_path/$(basename $(dirname $dir)) | |
done | |
tar czvf error_report_files_$TIMESTAMP.tar.gz error_report_files | |
- name: Error Report Files를 Artifacts에 업로드 | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: error_report_files | |
path: error_report_files_*.tar.gz |