Skip to content

Merge pull request #112 from team9502/dev #25

Merge pull request #112 from team9502/dev

Merge pull request #112 from team9502/dev #25

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: "/home/ec2-user"
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 }}"
export S3_ACCESS_KEY="${{ secrets.S3_ACCESS_KEY }}"
export S3_NAME="${{ secrets.S3_NAME }}"
export S3_REGION="${{ secrets.S3_REGION }}"
export SECRET_ACCESS_KEY="${{ secrets.SECRET_ACCESS_KEY }}"
export GOOGLE_ACCOUNT="${{ secrets.GOOGLE_ACCOUNT }}"
export GOOGLE_PASSWORD="${{ secrets.GOOGLE_PASSWORD }}"
export GOOGLE_CLIENT_ID="${{ secrets.GOOGLE_CLIENT_ID }}"
export GOOGLE_CLIENT_SECRET="${{ secrets.GOOGLE_CLIENT_SECRET }}"
export GOOGLE_REDIRECT_URI="${{ secrets.GOOGLE_REDIRECT_URI }}"
# JAR ํŒŒ์ผ์„ /home/ec2-user ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ์‹คํ–‰
nohup java -jar /home/ec2-user/*.jar > nohup.out 2>&1 &
env:
JDBC_URL: ${{ secrets.JDBC_URL }}
JDBC_USERNAME: ${{ secrets.JDBC_USERNAME }}
JDBC_PASSWORD: ${{ secrets.JDBC_PASSWORD }}
ENCRYPTION_SECRET_KEY: ${{ secrets.ENCRYPTION_SECRET_KEY }}
JWT_SECRETKEY: ${{ secrets.JWT_SECRETKEY }}
API_SERVICE_KEY: ${{ secrets.API_SERVICE_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_NAME: ${{ secrets.S3_NAME }}
S3_REGION: ${{ secrets.S3_REGION }}
SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}
GOOGLE_ACCOUNT: ${{ secrets.GOOGLE_ACCOUNT }}
GOOGLE_PASSWORD: ${{ secrets.GOOGLE_PASSWORD }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI }}