Skip to content

yaml : coockie, secure 변경 #168

yaml : coockie, secure 변경

yaml : coockie, secure 변경 #168

Workflow file for this run

name: CI-CD
on:
push:
branches:
- main
env:
S3_BUCKET_NAME: s3-cstudy
RESOURCE_PATH: ./module-api/src/main/resources/application.yml
CODE_DEPLOY_APPLICATION_NAME: CODE-DEPLOY-CSTUDY
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: CODE-DEPLOY-GROUP
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set yaml file
uses: microsoft/variable-substitution@v1
with:
files: ${{ env.RESOURCE_PATH }}
env:
spring.data.mongodb.uri: ${{ secrets.MONGODB_URL }}
spring.redis.host: ${{ secrets.REDIS_HOST }}
spring.datasource.url: ${{ secrets.MYSQL_URL }}
spring.datasource.username: ${{ secrets.MYSQL_USERNAME }}
spring.datasource.password: ${{ secrets.MYSQL_PASSWD }}
spring.mail.username: ${{ secrets.MAIL_USERNAME }}
spring.mail.password: ${{ secrets.MAIL_PASSWORD }}
spring.security.oauth2.client.registration.google.client-id: ${{ secrets.GOOGLE_CLIENT_ID }}
spring.security.oauth2.client.registration.google.client-secret: ${{ secrets.GOOGLE_SECRET }}
spring.security.oauth2.client.registration.google.redirect-uri: ${{ secrets.GOOGLE_REDIRECT_URI }}
spring.security.oauth2.client.registration.naver.client-id: ${{ secrets.NAVER_CLIENT_ID }}
spring.security.oauth2.client.registration.naver.client-secret: ${{ secrets.NAVER_SECRET }}
spring.security.oauth2.client.registration.naver.redirect-uri: ${{ secrets.NAVER_REDIRECT_URI }}
spring.security.oauth2.client.registration.kakao.client-id: ${{ secrets.KAKAO_CLIENT_ID }}
spring.security.oauth2.client.registration.kakao.redirect-uri: ${{ secrets.KAKAO_REDIRECT_URI }}
discord.bot.token: ${{ secrets.DISCORD_BOT }}
img.cloudFront: ${{ secrets.CLOUD_FRONT }}
jwt.secretKey: ${{ secrets.JWT_SECRET_KEY }}
jwt.refreshKey: ${{ secrets.JWT_REFRESH_KEY }}
cloud.aws.credentials.accessKey: ${{ secrets.FILE_ACCESS_KEY }}
cloud.aws.credentials.secretKey: ${{ secrets.FILE_SECRET_KEY }}
cloud.aws.s3.bucket: ${{ secrets.S3_BUCKET }}
cloud.aws.region.static: ${{ secrets.AWS_REGION }}
sentry.dsn: ${{ secrets.SENTRY_DSN }}
front.baseURL: ${{ secrets.FRONT_URL }}
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew clean :module-api:buildNeeded --stacktrace --info --refresh-dependencies -x test
shell: bash
- name: Make zip file
run: zip -r ./$GITHUB_SHA .
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip
- name: Code Deploy
run: |
aws deploy create-deployment \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \
--s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$GITHUB_SHA.zip
# Slack
# ssl 설정을 하고 etimeout
# - name: action-slack
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# author_name: Github Action Test # default: 8398a7@action-slack
# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
# if: always() # Pick up events even if the job fails or is canceled.