Skip to content

Commit

Permalink
cd(deploy): 배포 환경 변경 전 임시 주석 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Leegiyeon committed Jun 23, 2024
1 parent 443b364 commit 1789e55
Showing 1 changed file with 80 additions and 80 deletions.
160 changes: 80 additions & 80 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
name: Deploy-service

permissions:
contents: read
pull-requests: write

on:
push:
branches: ["main", "dev"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

- name: Install envsubst
run: sudo apt-get install -y gettext

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "${{ secrets.DB_YML }}" | base64 --decode > src/main/resources/application.yml
find src
- name: Make gradle.properties
run: |
echo "${{ secrets.GRADLE_PROPERTIES }}" | base64 --decode > gradle.properties
- name: Gradle 빌드
run: ./gradlew clean build
env:
DB_URL: ${{ secrets.DB_URL }}
DB_USER_NAME: ${{ secrets.DB_USER_NAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}

- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"

- name: Show Current Time
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}"
shell: bash

- name: Generate deployment package
run: |
mkdir -p deploy
JAR_FILE=$(find build/libs -name "*.jar" | head -n 1)
cp "$JAR_FILE" deploy/application.jar
cp Procfile deploy/Procfile
mkdir -p deploy/.ebextensions
mkdir -p deploy/.platform
if [ -d ".ebextensions" ]; then cp -r .ebextensions/* deploy/.ebextensions/; fi
if [ -d ".platform" ]; then cp -r .platform/* deploy/.platform/; fi
cd deploy && zip -r deploy.zip .
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: Triumers-Back
environment_name: Triumers-Back-env
version_label: github-action-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: deploy/deploy.zip
#name: Deploy-service
#
#permissions:
# contents: read
# pull-requests: write
#
#on:
# push:
# branches: ["main", "dev"]
#
#jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'corretto'
#
# - name: Grant execute permission for gradlew
# run: chmod +x ./gradlew
# shell: bash
#
# - name: Install envsubst
# run: sudo apt-get install -y gettext
#
# - name: Make application.yml
# run: |
# mkdir -p src/main/resources
# echo "${{ secrets.DB_YML }}" | base64 --decode > src/main/resources/application.yml
# find src
#
# - name: Make gradle.properties
# run: |
# echo "${{ secrets.GRADLE_PROPERTIES }}" | base64 --decode > gradle.properties
#
# - name: Gradle 빌드
# run: ./gradlew clean build
# env:
# DB_URL: ${{ secrets.DB_URL }}
# DB_USER_NAME: ${{ secrets.DB_USER_NAME }}
# DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
#
# - name: Get current time
# uses: 1466587594/get-current-time@v2
# id: current-time
# with:
# format: YYYY-MM-DDTHH-mm-ss
# utcOffset: "+09:00"
#
# - name: Show Current Time
# run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}"
# shell: bash
#
# - name: Generate deployment package
# run: |
# mkdir -p deploy
# JAR_FILE=$(find build/libs -name "*.jar" | head -n 1)
# cp "$JAR_FILE" deploy/application.jar
# cp Procfile deploy/Procfile
# mkdir -p deploy/.ebextensions
# mkdir -p deploy/.platform
# if [ -d ".ebextensions" ]; then cp -r .ebextensions/* deploy/.ebextensions/; fi
# if [ -d ".platform" ]; then cp -r .platform/* deploy/.platform/; fi
# cd deploy && zip -r deploy.zip .
#
# - name: Beanstalk Deploy
# uses: einaregilsson/beanstalk-deploy@v22
# with:
# aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# application_name: Triumers-Back
# environment_name: Triumers-Back-env
# version_label: github-action-${{steps.current-time.outputs.formattedTime}}
# region: ap-northeast-2
# deployment_package: deploy/deploy.zip

0 comments on commit 1789e55

Please sign in to comment.