Skip to content

fix: 파이프라인 구축 #10

fix: 파이프라인 구축

fix: 파이프라인 구축 #10

Workflow file for this run

name: Build and Deploy to EC2
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
defaults:
run:
shell: bash
env:
AWS_S3_BUCKET: 4k-backend-bucket
AWS_CODE_DEPLOY_APPLICATION: 4K-Backend-CD
AWS_CODE_DEPLOY_GROUP: 4K-Backend-CD-Group
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Grant execute permission for gradlew
working-directory: ./Backend
run: chmod +x ./gradlew
- name: Build Project and Test
working-directory: ./Backend
run: ./gradlew build test
- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql database: 'trip'
mysql user: ${DB_USERNAME}
mysql password: ${DB_PASSWORD}
- name: Configure AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ap-northeast-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}