docs: 아키텍처 수정 #23
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: githubAction | |
on: | |
push: | |
branches: | |
- develop | |
env: | |
NAME: stock-batch | |
REPO: investing-stock-batch | |
working-directory: ./stock-batch | |
S3_BUCKET_NAME: investing-batch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
mongodb-version: ['6.0'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 자바 17를 설치합니다. | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: 몽고디비를 설치한다. | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
mongodb-db: investing | |
- name: Gradle 명령 실행을 위한 권한을 부여합니다 | |
run: chmod +x gradlew | |
working-directory: ${{ env.working-directory }} | |
- name: 그래들 빌드를 실행한다. | |
run: ./gradlew build | |
working-directory: ${{ env.working-directory }} | |
- name: 파일을 압축한다. | |
run: zip -qq -r ./$GITHUB_SHA.zip . | |
shell: bash | |
- name: AWS 암호화 작업 | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
aws-region: ap-northeast-2 | |
- name: Upload to S3 #3 # S3에 업로드 | |
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$NAME/$GITHUB_SHA.zip | |
- name: 코드 디플로이를 실행한다. | |
run: aws deploy create-deployment --application-name investing-batch-deploy --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name investing-batch-deploy --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$NAME/$GITHUB_SHA.zip |