[DEV-77] 별도 권한 설정 없이 basic auth 적용하도록 변경 #84
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: prod-server-deployer | |
on: | |
push: | |
branches: | |
- chore/DEV-77 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Set yaml file | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./src/main/resources/application.yml | |
env: | |
spring.datasource.url: ${{secrets.DB_URL}} | |
spring.datasource.username: ${{secrets.DB_USERNAME}} | |
spring.datasource.password: ${{secrets.DB_PASSWORD}} | |
spring.s3.bucket: ${{secrets.BUCKET_NAME}} | |
sprig.s3.access-key: ${{secrets.AWS_ACCESS_KEY_ID}} | |
sprig.s3.secret-key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
cloud.aws.region.static: ${{secrets.AWS_DEFAULT_REGION}} | |
jwt.secret: ${{secrets.JWT_SECRET}} | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
shell: bash | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" # 한국 시간에 맞추기 위함 | |
# grandle build를 통해 만들어진 jar를 beanstalk에 배포하기 위한 zip 파일로 만드는 것 | |
- name: Generate deployment package | |
run: | | |
mkdir -p deploy | |
cp build/libs/*.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp -r promtail deploy/promtail | |
cp -r nodeexporter deploy/nodeexporter | |
cp -r .ebextensions deploy/.ebextensions | |
cp -r .platform deploy/.platform | |
cd deploy && zip -r deploy.zip . | |
# Beanstalk Deploy 플러그인 사용 | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} # github secrets로 등록한 값 사용 | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # github secrets로 등록한 값 사용 | |
application_name: ddingdong-dev # EB application 이름 | |
environment_name: ddingdong-dev-env # EB environment 이름 | |
version_label: Github Action-${{steps.current-time.outputs.formattedTime}} # 배포 버전은 타임스탬프를 이용하여 구분 | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip | |
wait_for_environment_recovery: 300 | |
- name: Test with Gradle | |
run: ./gradlew test --no-daemon |