From 5e6a9b690261cbe376208985e8cfa0b890ef1065 Mon Sep 17 00:00:00 2001 From: huncozyboy Date: Mon, 30 Dec 2024 17:25:25 +0900 Subject: [PATCH] feat : cicd test --- .github/workflows/cicd.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/cicd.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..7d58a17 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,44 @@ +name: CI/CD + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - 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 + + - name: Get current time + uses: josStorer/get-current-time@v2.0.2 + 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: spring-boot-developer + environment_name: SpringBootDeveloper-env + version_label: github-action-${{steps.current-time.outputs.formattedTime}} + region: ap-northeast-2 + deployment_package: ./build/libs/${{env.artifact}} \ No newline at end of file