Skip to content

Commit

Permalink
Chore: deploy.yml update 01
Browse files Browse the repository at this point in the history
  • Loading branch information
chosoobin37 committed Jun 28, 2024
1 parent 4452c2c commit 250d514
Showing 1 changed file with 61 additions and 2 deletions.
63 changes: 61 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,47 @@ jobs:
run: chmod +x ./gradlew
shell: bash

- name: Create application.yml.template
run: |
mkdir -p src/main/resources
cat > src/main/resources/application.yml.template <<EOL
server:
port: 8081
spring:
datasource:
driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://\${RDS_HOSTNAME}:\${RDS_PORT}/\${RDS_DB_NAME}
username: \${RDS_USERNAME}
password: \${RDS_PASSWORD}
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
use_sql_comments: true
EOL
- name: Set Yaml
run: |
envsubst < src/main/resources/application.yml.template > src/main/resources/application.yml
echo "Generated application.yml:"
cat src/main/resources/application.yml
env:
RDS_HOSTNAME: ${{ secrets.RDS_HOSTNAME }}
RDS_PORT: ${{ secrets.RDS_PORT }}
RDS_DB_NAME: ${{ secrets.RDS_DB_NAME }}
RDS_USERNAME: ${{ secrets.RDS_USERNAME }}
RDS_PASSWORD: ${{ secrets.RDS_PASSWORD }}

- name: Build with Gradle
run: ./gradlew clean build
run: ./gradlew clean build -x test
shell: bash

- name: List build/libs directory
run: ls -la build/libs
shell: bash

- name: Get current time
Expand All @@ -40,4 +79,24 @@ jobs:

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

- name: Generate deployment package
run: |
mkdir -p deploy
cp build/libs/erpc-0.0.1-SNAPSHOT.jar deploy/application.jar
cp Procfile deploy/Procfile
cp -r .ebextensions deploy/.ebextensions
cp -r .platform deploy/.platform
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: erpc-back-ver2
# environment_name: Erpc-back-ver2-env-1
# version_label: github-action-${{steps.current-time.outputs.formattedTime}}
# region: ap-northeast-2
# deployment_package: deploy/deploy.zip

0 comments on commit 250d514

Please sign in to comment.