Skip to content

Commit

Permalink
chore: workflows ์„ค์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw1031 committed Nov 28, 2023
1 parent 14d4465 commit 1711d27
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI/CD

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Spring Boot application
run: ./gradlew clean build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload S3
run: aws deploy push
--application-name LikeKNU
--ignore-hidden-files
--s3-location s3://like-knu-bucket/archive/$GITHUB_SHA.zip
--source .

- name: Deploy EC2
run: aws deploy create-deployment
--application-name LikeKNU
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name LikeKNU-Deployment-group
--s3-location bucket=like-knu-bucket,key=archive/$GITHUB_SHA.zip,bundleType=zip

0 comments on commit 1711d27

Please sign in to comment.