Skip to content

Hotfix/v1.1.0 release3 (#187) #74

Hotfix/v1.1.0 release3 (#187)

Hotfix/v1.1.0 release3 (#187) #74

name: Java CI with Gradle
on:
push:
branches: [ "master" ]
jobs:
build:
environment: aws
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Create application.yml files
run: |
mkdir -p ${{ secrets.APPLICATION_PATH }}/yaml
echo "${{ secrets.APPLICATION_YML }}" > ${{ secrets.APPLICATION_PATH }}/application.yml
echo "${{ secrets.APPLICATION_PROD_YML }}" > ${{ secrets.APPLICATION_PATH }}/yaml/application-prod.yml
echo "${{ secrets.APPLICATION_DEV_YML }}" > ${{ secrets.APPLICATION_PATH }}/yaml/application-dev.yml
echo "${{ secrets.APPLICATION_OAUTH_YML }}" > ${{ secrets.APPLICATION_PATH }}/yaml/application-oauth.yml
echo "${{ secrets.APPLICATION_TEST_YML }}" > ${{ secrets.APPLICATION_TEST_PATH }}/application-test.yml
- name: Build with Gradle Wrapper
run: ./gradlew clean build -Pspring.profiles.active=test
- name: AWS credential
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_NAME }}
role-session-name: GithubActions
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: S3 upload
run: aws deploy push --application-name ${{ secrets.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://${{ secrets.AWS_S3_BUCKET }}/cicd/$GITHUB_SHA.zip --source .
- name: CodeDeploy
run: aws deploy create-deployment --application-name ${{ secrets.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ secrets.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=${{ secrets.AWS_S3_BUCKET }},key=cicd/$GITHUB_SHA.zip,bundleType=zip
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0