Fix DIG-160: 카카오 소셜 친구목록 받아오기 #46
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: CD | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Create application.properties | |
run: | | |
echo "${{ secrets.APPLICATION }}" | base64 --decode > ./src/main/resources/application.yml | |
echo "${{ secrets.APPLICATION_DEV }}" | base64 --decode > ./src/main/resources/application-dev.yml | |
echo "${{ secrets.APPLICATION_OAUTH }}" | base64 --decode > ./src/main/resources/application-oauth.yml | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build without Test in Gradle | |
run: ./gradlew build -x test | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/ggg:latest | |
- name: Zip the docker-compose file | |
run: zip -j deployment docker-compose.yml | |
- name: Deploy to Elastic Beanstalk | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
application_name: OGJG | |
environment_name: OGJG-env | |
version_label: OGJG_Deploy-${{ github.SHA }} | |
region: ${{ secrets.AWS_REGION }} | |
deployment_package: deployment.zip | |
use_existing_version_if_available: true | |
wait_for_environment_recovery: 180 |