Skip to content

[BE] chore : ci/cd 파일 수정 #17

[BE] chore : ci/cd 파일 수정

[BE] chore : ci/cd 파일 수정 #17

Workflow file for this run

name: Backend Build with Gradle
on:
push:
branches: [ "backend-main" ]
pull_request:
branches: [ "main", "backend-main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('backend/**/*.gradle*', 'backend/**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Create Config
run: |
mkdir -p src/main/resources
mkdir -p src/test/resources
echo "${{ secrets.MAIN_APPLICATION_YML }}" > src/main/resources/application.yml
echo "${{ secrets.MAIN_APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml
echo "${{ secrets.MAIN_APPLICATION_PROD_YML }}" > src/main/resources/application-prod.yml
echo "${{ secrets.TEST_APPLICATION_YML }}" > src/test/resources/application.yml
echo "${{ secrets.TEST_APPLICATION_TEST_YML }}" > src/test/resources/application-test.yml
working-directory: backend
- name: Grant execute permission for Gradle

Check failure on line 46 in .github/workflows/backend-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/backend-build.yml

Invalid workflow file

You have an error in your yaml syntax on line 46
run: chmod +x gradlew
working-directory: backend
- name: Build with Gradle
run: ./gradlew build
working-directory: backend
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add SSH key to known hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan ${{ secrets.BE_SERVER_IP }} >> ~/.ssh/known_hosts
- name: SCP transfer
run: scp backend/build/libs/*.jar ${{ secrets.SSH_USER }}@${{ secrets.BE_SERVER_IP }}:~/deploy