Skip to content

feat: Github Action 을 통한 CI/CD 구축 (#69) #1

feat: Github Action 을 통한 CI/CD 구축 (#69)

feat: Github Action 을 통한 CI/CD 구축 (#69) #1

Workflow file for this run

name: Release CI/CD
on:
push:
branches:
- feature/69
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
env:
SPRING_PROFILE: release
JWT_SECRET: ${{ secrets.JWT_SECRET }}
DB_URL: ${{ secrets.DB_URL }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
REDIS_URL: ${{ secrets.REDIS_URL }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
- name: Get current time
uses: josStorer/[email protected]
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
- name: Set artifact
run: echo "artifact=$(ls ./build/libs)" >> $GITHUB_ENV
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: smunity
environment_name: smunity-env
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: ./build/libs/${{env.artifact}}