Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ghghtygh authored Mar 15, 2024
1 parent 37a3417 commit 9a33fb0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ jobs:
java-version: '17'
distribution: 'temurin'

# Gradle 캐싱 적용
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# prod yml 파일 생성
- name: Build application-prod.yml
run: |
touch ./src/main/resources/application-prod.yml
echo "${{ SPRING_PROD_CONFIG }}" > ./src/main/resources/application-prod.yml
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
Expand All @@ -46,6 +63,7 @@ jobs:
- name: Build with Gradle Wrapper
run: |
chmod +x gradlew
echo "$"
./gradlew build -x test
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
Expand All @@ -69,6 +87,18 @@ jobs:
source: "build/libs/*.jar"
target: ${{ secrets.SERVER_DEPLOY_DIR }}

- name: Deploy prod
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ${{ secrets.SERVER_DEPLOY_DIR }}
./${{ secrets.SERVER_DEPLOY_FILE_1 }}
dependency-submission:
runs-on: ubuntu-latest
permissions:
Expand Down

0 comments on commit 9a33fb0

Please sign in to comment.