Skip to content

chore: 배포 스크립트 수정 (#25) #8

chore: 배포 스크립트 수정 (#25)

chore: 배포 스크립트 수정 (#25) #8

Workflow file for this run

name: CD
on:
push:
branches: [ "dev" ]
env:
S3_BUCKET_NAME: verby-bucket
PROJECT_NAME: indp-server
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONS_TOKEN }}
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew clean build
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Make zip file
run: zip -r ./$GITHUB_SHA.zip .
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-northeast-2
aws-access-key-id: ${{ secrets.AWS_ACCESS }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS }}
- name: Upload 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 verby-deploy \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name verby-dev \
--s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip \