Files
hexagonal/.github/workflows/cicd-branch-main.yml
Workflow config file is invalid. Please check your config file: yaml: line 14: did not find expected '-' indicator

47 lines
1.5 KiB
YAML

name: cicd branch main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: checkout src
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
- name: Grant execute permission for gradlew
run: chmod 777 gradlew
shell: bash
- name: Clean build test with Gradle # clean build test
run: ./gradlew clean build test
shell: bash
- name: Make zip file # zip 파일 생성
run: zip -r ./springboot-blog.zip .
shell: bash
- name: Configure AWS credentials # 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: ${{ secrets.AWS_REGION }}
- name: Upload to S3 # S3 업로드
run: aws s3 cp --region ${{ secrets.AWS_REGION }} ./springboot-blog.zip s3://${{ secrets.AWS_S3_BUCKET }}/CI/springboot-blog.zip
- name: Code Deploy # CodeDeploy에 배포 요청
run: aws deploy create-deployment --application-name ${{ secrets.AWS_CODEDEPLOY_NAME }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ secrets.AWS_CODEDEPLOY_GROUP }} --s3-location bucket=${{ secrets.AWS_S3_BUCKET }},bundleType=zip,key=CI/springboot-blog.zip