Skip to content

chore: 배포 스크립트 수정 #6

chore: 배포 스크립트 수정

chore: 배포 스크립트 수정 #6

Workflow file for this run

name: deploy
on:
push:
branches:
- '**'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

Check failure on line 19 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 19
- name: make application-secret.yml
run: |
# application-secret.yml 파일 생성
# touch ./src/main/resources/application-secret.yml
# GitHub-Actions 에서 설정한 값을 application-secret.yml 파일에 쓰기
echo "${{ secrets.SECRET }}" > ./src/main/resources/application-secret.yml
shell: bash
- name: Build with Gradle
run: |
chmod +x gradlew
# Run Gradle build
./gradlew build -x test
- name: Create SSH key file
env:
SCP_KEY: ${{ secrets.KEY }}
run: |
echo "${{ secrets.KEY }}" > scp_key.pem
chmod 600 scp_key.pem
- name: Copy JAR to EC2
env:
SCP_USER: ${{ secrets.USER }}
SCP_HOST: ${{ secrets.HOST }}
SCP_PATH: ${{ secrets.PATH }}
run: |
scp -v -o StrictHostKeyChecking=no -i scp_key.pem ./build/libs/*.jar $SCP_USER@$SCP_HOST:$SCP_PATH
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.KEY }}
script: |
cd ${{ secrets.PATH }}
nohup java -jar *.jar > app.log 2>&1 &