Skip to content

[env] 모든 서비스 bootstrap.yml config-server uri 수정 (#462) #30

[env] 모든 서비스 bootstrap.yml config-server uri 수정 (#462)

[env] 모든 서비스 bootstrap.yml config-server uri 수정 (#462) #30

name: Notification Service CI
on:
push:
branches:
- main
- develop
paths:
- "notification-service/**"
env:
S3_BUCKET_NAME: ssafy-otd-codedeploy
AWS_REGION: ap-northeast-2
CODEDEPLOY_NAME: ssafy-otd-codedeploy
CODEDEPLOY_GROUP: ssafy-otd-notification-service-group
TARGET_PROJECT: notification-service
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./${{ env.TARGET_PROJECT }}
steps:
- uses: actions/checkout@v3
- name: Grant Permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew clean build -x test
- name: Make zip file
run: zip -r ./$GITHUB_SHA.zip .
- name: Configure AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
- name: Upload to S3
run: aws s3 cp --region $AWS_REGION ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$TARGET_PROJECT/$GITHUB_SHA.zip
- name: Code Deploy
run: |
aws deploy create-deployment \
--application-name $CODEDEPLOY_NAME \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name $CODEDEPLOY_GROUP \
--s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$TARGET_PROJECT/$GITHUB_SHA.zip