Skip to content

sinChul

sinChul #6

Workflow file for this run

name: sinChul
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: gradlew bootJar
run: ./gradlew bootJar
- name: copy jar to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ec2-user
key: ${{ secrets.SSH_KEY }}
port: 22
source: "./build/libs/*.jar"
target: "~"
strip_components: 2
- name: SSH Commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ec2-user
key: ${{ secrets.SSH_KEY }}
port: 22
script_stop: true
script: |
export jdbc_url="${{ secrets.jdbc_url }}"
export jdbc_username="${{ secrets.jdbc_username }}"
export jdbc_password="${{ secrets.jdbc_password }}"
export ENCRYPTION_SECRET_KEY="${{ secrets.ENCRYPTION_SECRET_KEY }}"
export jwt_secretKey="${{ secrets.jwt_secretKey }}"
export API_SERVICE_KEY="${{ secrets.API_SERVICE_KEY }}"
java -jar *.jar &
env:
jdbc_url: ${{ secrets.jdbc_url }}
jdbc_username: ${{ secrets.jdbc_username }}03
jdbc_password: ${{ secrets.jdbc_password }}
ENCRYPTION_SECRET_KEY: ${{ secrets.ENCRYPTION_SECRET_KEY }}
jwt_secretKey: ${{ secrets.jwt_secretKey }}
API_SERVICE_KEY: ${{ secrets.API_SERVICE_KEY }}