Skip to content

Create ReadMe.md

Create ReadMe.md #5

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Deployment
on:
workflow_dispatch:
push:
branches: [ "main" ]
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'
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
- uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs
send-jar:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download jar
uses: actions/download-artifact@v3
with:
name: jar
- name: Send jar to remote server
uses: appleboy/scp-action@master
with:
host: {나의 public ip}

Check failure on line 49 in .github/workflows/deployment_scp.yml

View workflow run for this annotation

GitHub Actions / Deployment

Invalid workflow file

The workflow is not valid. .github/workflows/deployment_scp.yml (Line: 49, Col: 17): A mapping was not expected .github/workflows/deployment_scp.yml (Line: 50, Col: 21): A mapping was not expected
username: {나의 userName}
source: "devlog_springboot-0.0.1-SNAPSHOT.jar"
target: "/home/{나의 userName}"
key: ${{ secrets.PRIVATE_KEY }}
run-app:
needs: send-jar
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Move deploy.sh
uses: appleboy/scp-action@master
with:
host: {나의 public ip}
username: {나의 userName}
source: "deploy.sh"
target: "/home/{나의 userName}"
key: ${{ secrets.PRIVATE_KEY }}
- name: Execute script
uses: appleboy/ssh-action@master
with:
username: {나의 userName}
host: {나의 public ip}
key: ${{ secrets.PRIVATE_KEY }}
script_stop: true
script: cd /home/{나의 userName} && chmod +x deploy.sh && ./deploy.sh