Skip to content

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

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

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

name: Sender Server CI
on:
push:
branches:
- main
- develop
paths:
- "sender-server/**"
env:
S3_BUCKET_NAME: ssafy-otd-codedeploy
AWS_REGION: ap-northeast-2
CODEDEPLOY_NAME: ssafy-otd-codedeploy
CODEDEPLOY_GROUP: ssafy-otd-sender-server-group
TARGET_PROJECT: sender-server
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./${{ env.TARGET_PROJECT }}
steps:
- uses: actions/checkout@v3
- name: Create Directory
run: mkdir -p src/main/resources/fcm
- name: Copy FCM token
run: echo "${{ secrets.FCM_TOKEN }}" > src/main/resources/fcm/openthedoor-930e4-firebase-adminsdk-t332b-aa9888ba26.json
- 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