โจ Feat: ๋ก๊ทธ์์ api, ํ ํฐ ๊ฐฑ์ api ๊ตฌํ #62
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: TheGoods Dev CI/CD | |
on: | |
pull_request: | |
types: [ closed ] | |
workflow_dispatch: # (2).์๋ ์คํ๋ ๊ฐ๋ฅํ๋๋ก | |
jobs: | |
build: | |
runs-on: ubuntu-latest # (3).OSํ๊ฒฝ | |
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 # (4).์ฝ๋ check out | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 # (5).์๋ฐ ์ค์น | |
distribution: 'adopt' | |
- name: Set Environment | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./src/main/resources/application-dev.yml | |
env: | |
spring.datasource.url: ${{ secrets.DB_URL }} | |
spring.datasource.username: ${{ secrets.DB_USER }} | |
spring.datasource.password: ${{ secrets.DB_PASSWORD }} | |
jwt.token.secret: ${{ secrets.JWT_TOKEN_SECRET }} | |
spring.mail.username: ${{ secrets.SPRING_MAIL_USERNAME }} | |
spring.mail.password: ${{ secrets.SPRING_MAIL_PASSWORD }} | |
cloud.aws.credentials.accessKey: ${{ secrets.CLOUD_AWS_CREDENTIALS_ACCESSKEY }} | |
cloud.aws.credentials.secretKey: ${{ secrets.CLOUD_AWS_CREDENTIALS_SECRETKEY }} | |
social.kakao.client-id: ${{ secrets.KAKAO_CLIENT_ID }} | |
social.kakao.redirect-uri: ${{ secrets.KAKAO_REDIRECT_URI }} | |
social.naver.client-id: ${{ secrets.NAVER_CLIENT_ID }} | |
social.naver.redirect-uri: ${{ secrets.NAVER_REDIRECT_URI }} | |
social.naver.client-secret: ${{ secrets.NAVER_CLIENT_SECRET }} | |
iamport.key: ${{ secrets.IAMPORT_KEY }} | |
iamport.secret: ${{ secrets.IAMPORT_SECRET }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash # (6).๊ถํ ๋ถ์ฌ | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
shell: bash # (7).build ์์ | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" # (8).build ์์ ์ ์๊ฐํ๋ณด | |
- name: Show Current Time | |
run: echo "CurrentTime=$" | |
shell: bash # (9).ํ๋ณดํ ์๊ฐ ๋ณด์ฌ์ฃผ๊ธฐ | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp build/libs/*.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp -r .ebextensions_dev deploy/.ebextensions | |
cp -r .platform deploy/.platform | |
cd deploy && zip -r deploy.zip . | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v20 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }} | |
application_name: cicd-test | |
environment_name: Cicd-test-env | |
version_label: github-action-${{ steps.current-time.outputs.formattedTime }} | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip | |
wait_for_deployment: false |