Skip to content

[Merge] main <- seyong#155-refactoring #81

[Merge] main <- seyong#155-refactoring

[Merge] main <- seyong#155-refactoring #81

Workflow file for this run

name: CD with Gradle
on:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Download application YML
run: |
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_YML }}" | base64 --decode > src/main/resources/application.yml
find src
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Gradle build
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build -x test
- name: SCP files to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PWD }}
port: 6322
source: "./build/libs/*.jar"
target: /home/snaptime/deploy
- name: Execute script via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PWD }}
port: 6322
script_stop: true
script: |
cd /home/snaptime/deploy
sh deploy.sh