Skip to content

Settings : Github Action 기능 추가 #26

Settings : Github Action 기능 추가

Settings : Github Action 기능 추가 #26

Workflow file for this run

name: Java CI with Gradle
#env:
# PROJECT_NAME: orury
# BUCKET_NAME: orury-bucket
# CODE_DEPLOY_APP_NAME: orury-deploy
# DEPLOYMENT_GROUP_NAME: orury-deploy-group
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
pull_request:
types: [ opened, reopened, synchronize ]
# push:
# branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: clean build
close-pr:
runs-on: ubuntu-latest
needs: build
if: ${{ failure() }}
steps:
# - name: Close Pull
# run: gh pr close --comment "Auto-closing pull request" --delete-branch ${{ github.event.number }}
- name: Upload log file
uses: actions/upload-artifact@v2
with:
name: gradle-build-log
path: build/reports
# Build JAR file instead of zipping the entire project
# - name: Build JAR
# run: ./gradlew build
# 나중을 위한 자동 CI/CD
# - name: Make Zip File
# run: zip -qq -r ./$GITHUB_SHA.zip .
#
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} # 등록한 Github Secret이 자동으로 불려온다.
# aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }} # 등록한 Github Secret이 자동으로 불려온다.
# aws-region: ap-northeast-2
#
# - name: Upload to S3
# run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip
#
# - name: Code Deploy
# run: aws deploy create-deployment --application-name $CODE_DEPLOY_APP_NAME --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name $DEPLOYMENT_GROUP_NAME --s3-location bucket=$BUCKET_NAME,bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip
#