Skip to content

Commit

Permalink
feat: cicd 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
hanueleee committed Dec 31, 2023
1 parent 75c834d commit 6925b48
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/cicd-be.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Backend CI/CD

on:
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Repository
uses: actions/checkout@v3

- name: Set up JDK11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

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

- name: Build with Gradle
run: ./gradlew clean build

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: cicdsample
path: build/libs/*.jar

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: cicdsample

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: SCP transfer
run: scp *.jar ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:~/cicd

- name: Execute remote shell script
run: |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "./deploy.sh"

0 comments on commit 6925b48

Please sign in to comment.