Skip to content

Commit

Permalink
chore: prod ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
DWL21 committed Feb 14, 2025
1 parent ccd2d35 commit 7ac1123
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/prod-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Prod - CI/CD with Tests

on:
pull_request:
branches: [ "main" ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

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

- name: Clean Build with Gradle (without Test)
run: |
echo ${{ secrets.APPLICATION_PROD_YML }} | base64 --decode > ./src/main/resources/application-prod.yml
echo ${{ secrets.APPLICATION_YML_PROD_MODE }} | base64 --decode > ./src/main/resources/application.yml
./gradlew clean build
5 changes: 1 addition & 4 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Prod - CI/CD with Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-and-deploy:
Expand All @@ -30,12 +28,11 @@ jobs:
- name: Clean Build with Gradle (without Test)
run: |
echo ${{ secrets.APPLICATION_PROD_YML }} | base64 --decode > ./src/main/resources/application-prod.yml
echo ${{ secrets.APPLICATION_YML_PROD_MODE }} | base64 --decode > ./src/main/resources/application.yml
./gradlew clean build
- name: Deploy to EC2
env:
PRIVATE_KEY: ${{ secrets.YOURSSU_SECRET}}
PRIVATE_KEY: ${{ secrets.YOURSSU_SECRET }}
HOST: ${{ secrets.YOURSSU_PROD_HOST }}
run: |
mkdir -p ~/.ssh
Expand Down

0 comments on commit 7ac1123

Please sign in to comment.