Merge pull request #284 from fourix4/dev #159
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: CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.TAEHOON_TOKEN }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Set Environment for application.yml | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./src/main/resources/application.yml | |
env: | |
spring.datasource.url: ${{ secrets.DB_URL }} | |
spring.datasource.username: ${{ secrets.DB_USER }} | |
spring.datasource.password: ${{ secrets.DB_PASSWORD }} | |
jwt.secret.key: ${{ secrets.JWT_SECRET_KEY }} | |
spring.data.redis.host: ${{ secrets.REDIS_HOST }} | |
spring.data.redis.password: ${{ secrets.REDIS_PASSWORD }} | |
kakaopay.secret-key: ${{ secrets.KAKAOPAY_KEY }} | |
kakaopay.cid: ${{ secrets.KAKAOPAY_CID }} | |
kakaopay.ready-url: ${{ secrets.KAKAOPAY_READY_URL }} | |
kakaopay.approve-url: ${{ secrets.KAKAOPAY_APPROVE_URL }} | |
kakaopay.cancel-url : ${{ secrets.KAKAOPAY_CANCEL_URL }} | |
cloud.aws.credentials.access-key: ${{ secrets.AWS_S3_ACCESS_KEY }} | |
cloud.aws.credentials.secret-key: ${{ secrets.AWS_S3_SECRET_KEY }} | |
- name: Set Environment for application-oauth.yml | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./src/main/resources/application-oauth.yml | |
env: | |
spring.security.oauth2.client.registration.kakao.client-id: ${{ secrets.KAKAO_CLIENT_ID }} | |
spring.security.oauth2.client.registration.kakao.redirect-uri: ${{ secrets.KAKAO_REDIRECT_URI }} | |
google.client_id: ${{ secrets.GOOGLE_CLIENT_ID }} | |
google.client_secret: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
google.redirect_uri: ${{ secrets.GOOGLE_REDIRECT_URI }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build -x test | |
- name: Get current time | |
uses: josStorer/[email protected] | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" | |
- name: catchstudy Set artifact | |
run: echo "artifact=$(ls ./build/libs | grep -v 'plain')" >> $GITHUB_ENV | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }} | |
application_name: catch-study | |
environment_name: Catch-study-env | |
version_label: catch-study-${{ steps.current-time.outputs.formattedTime }} | |
region: ap-northeast-2 | |
deployment_package: ./build/libs/${{ env.artifact }} | |
wait_for_environment_recovery: 500 |