fix: Delete and integrate mission category (#140) #96
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: Uni Build Jar Code Delivery | |
on: | |
push: | |
branches: | |
- main | |
- feat/cd | |
permissions: | |
contents: read | |
env: | |
S3_BUCKET_NAME: springboot-uni-sparkle | |
PROJECT_NAME: uni-sparkle | |
jobs: | |
delivery: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
submodules: true | |
- name: Gradle cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Copy Config | |
run: ./gradlew copyConfig | |
- name: Build jar | |
run: ./gradlew bootjar | |
- name: Make zip File | |
run: zip -r ./$GITHUB_SHA.zip . | |
- name: Configure AWS Credentials For GitHub Actions | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY}} | |
aws-secret-access-key: ${{secrets.AWS_SECRET_KEY}} | |
aws-region: ${{secrets.AWS_REGION}} | |
- name: Upload zip file to S3 | |
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip | |
- name: Code Deploy | |
run: | | |
aws deploy create-deployment --application-name uni-sparkle-deploy --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name uni-sparkle-deploy-group --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip |